OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #import "ios/chrome/browser/ui/toolbar/toolbar_controller.h" | 5 #import "ios/chrome/browser/ui/toolbar/toolbar_controller.h" |
6 | 6 |
7 #include <QuartzCore/QuartzCore.h> | 7 #include <QuartzCore/QuartzCore.h> |
8 | 8 |
9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 backgroundFrame.size.height += statusBarOffset; | 279 backgroundFrame.size.height += statusBarOffset; |
280 stackButtonFrame.origin.y += statusBarOffset; | 280 stackButtonFrame.origin.y += statusBarOffset; |
281 toolsMenuButtonFrame.origin.y += statusBarOffset; | 281 toolsMenuButtonFrame.origin.y += statusBarOffset; |
282 } | 282 } |
283 | 283 |
284 view_ = [[ToolbarView alloc] initWithFrame:viewFrame]; | 284 view_ = [[ToolbarView alloc] initWithFrame:viewFrame]; |
285 backgroundView_ = [[UIImageView alloc] initWithFrame:backgroundFrame]; | 285 backgroundView_ = [[UIImageView alloc] initWithFrame:backgroundFrame]; |
286 toolsMenuButton_ = | 286 toolsMenuButton_ = |
287 [[ToolbarToolsMenuButton alloc] initWithFrame:toolsMenuButtonFrame | 287 [[ToolbarToolsMenuButton alloc] initWithFrame:toolsMenuButtonFrame |
288 style:style_]; | 288 style:style_]; |
289 [toolsMenuButton_ setTag:IDC_SHOW_TOOLS_MENU]; | 289 [toolsMenuButton_ addTarget:self.dispatcher |
| 290 action:@selector(showToolsMenu) |
| 291 forControlEvents:UIControlEventTouchUpInside]; |
290 [toolsMenuButton_ | 292 [toolsMenuButton_ |
291 setAutoresizingMask:UIViewAutoresizingFlexibleLeadingMargin() | | 293 setAutoresizingMask:UIViewAutoresizingFlexibleLeadingMargin() | |
292 UIViewAutoresizingFlexibleBottomMargin]; | 294 UIViewAutoresizingFlexibleBottomMargin]; |
293 | 295 |
294 [view_ addSubview:backgroundView_]; | 296 [view_ addSubview:backgroundView_]; |
295 [view_ addSubview:toolsMenuButton_]; | 297 [view_ addSubview:toolsMenuButton_]; |
296 [view_ setAutoresizingMask:UIViewAutoresizingFlexibleWidth]; | 298 [view_ setAutoresizingMask:UIViewAutoresizingFlexibleWidth]; |
297 [backgroundView_ setAutoresizingMask:UIViewAutoresizingFlexibleWidth | | 299 [backgroundView_ setAutoresizingMask:UIViewAutoresizingFlexibleWidth | |
298 UIViewAutoresizingFlexibleHeight]; | 300 UIViewAutoresizingFlexibleHeight]; |
299 | 301 |
(...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1040 #pragma mark - | 1042 #pragma mark - |
1041 #pragma mark PopupMenuDelegate methods. | 1043 #pragma mark PopupMenuDelegate methods. |
1042 | 1044 |
1043 - (void)dismissPopupMenu:(PopupMenuController*)controller { | 1045 - (void)dismissPopupMenu:(PopupMenuController*)controller { |
1044 if ([controller isKindOfClass:[ToolsPopupController class]] && | 1046 if ([controller isKindOfClass:[ToolsPopupController class]] && |
1045 (ToolsPopupController*)controller == toolsPopupController_) | 1047 (ToolsPopupController*)controller == toolsPopupController_) |
1046 [self dismissToolsMenuPopup]; | 1048 [self dismissToolsMenuPopup]; |
1047 } | 1049 } |
1048 | 1050 |
1049 @end | 1051 @end |
OLD | NEW |