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 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
585 if (toolsPopupController_) | 585 if (toolsPopupController_) |
586 return; | 586 return; |
587 | 587 |
588 base::RecordAction(UserMetricsAction("ShowAppMenu")); | 588 base::RecordAction(UserMetricsAction("ShowAppMenu")); |
589 | 589 |
590 // Keep the button pressed. | 590 // Keep the button pressed. |
591 [toolsMenuButton_ setToolsMenuIsVisible:YES]; | 591 [toolsMenuButton_ setToolsMenuIsVisible:YES]; |
592 | 592 |
593 [configuration setToolsMenuButton:toolsMenuButton_]; | 593 [configuration setToolsMenuButton:toolsMenuButton_]; |
594 toolsPopupController_ = | 594 toolsPopupController_ = |
595 [[ToolsPopupController alloc] initWithConfiguration:configuration]; | 595 [[ToolsPopupController alloc] initWithConfiguration:configuration |
| 596 dispatcher:self.dispatcher]; |
596 | 597 |
597 [toolsPopupController_ setDelegate:self]; | 598 [toolsPopupController_ setDelegate:self]; |
598 | 599 |
599 [[NSNotificationCenter defaultCenter] | 600 [[NSNotificationCenter defaultCenter] |
600 postNotificationName:kMenuWillShowNotification | 601 postNotificationName:kMenuWillShowNotification |
601 object:nil]; | 602 object:nil]; |
602 } | 603 } |
603 | 604 |
604 - (void)dismissToolsMenuPopup { | 605 - (void)dismissToolsMenuPopup { |
605 if (!toolsPopupController_) | 606 if (!toolsPopupController_) |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1037 #pragma mark - | 1038 #pragma mark - |
1038 #pragma mark PopupMenuDelegate methods. | 1039 #pragma mark PopupMenuDelegate methods. |
1039 | 1040 |
1040 - (void)dismissPopupMenu:(PopupMenuController*)controller { | 1041 - (void)dismissPopupMenu:(PopupMenuController*)controller { |
1041 if ([controller isKindOfClass:[ToolsPopupController class]] && | 1042 if ([controller isKindOfClass:[ToolsPopupController class]] && |
1042 (ToolsPopupController*)controller == toolsPopupController_) | 1043 (ToolsPopupController*)controller == toolsPopupController_) |
1043 [self dismissToolsMenuPopup]; | 1044 [self dismissToolsMenuPopup]; |
1044 } | 1045 } |
1045 | 1046 |
1046 @end | 1047 @end |
OLD | NEW |