OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "chrome/browser/ui/cocoa/extensions/browser_actions_controller.h" | 5 #import "chrome/browser/ui/cocoa/extensions/browser_actions_controller.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 [button setAlphaValue:0.0]; | 739 [button setAlphaValue:0.0]; |
740 } | 740 } |
741 } | 741 } |
742 | 742 |
743 - (BOOL)browserActionClicked:(BrowserActionButton*)button | 743 - (BOOL)browserActionClicked:(BrowserActionButton*)button |
744 shouldGrant:(BOOL)shouldGrant { | 744 shouldGrant:(BOOL)shouldGrant { |
745 const Extension* extension = [button extension]; | 745 const Extension* extension = [button extension]; |
746 GURL popupUrl; | 746 GURL popupUrl; |
747 switch (toolbarModel_->ExecuteBrowserAction(extension, browser_, &popupUrl, | 747 switch (toolbarModel_->ExecuteBrowserAction(extension, browser_, &popupUrl, |
748 shouldGrant)) { | 748 shouldGrant)) { |
749 case extensions::ExtensionToolbarModel::ACTION_NONE: | 749 case ExtensionAction::ACTION_NONE: |
750 break; | 750 break; |
751 case extensions::ExtensionToolbarModel::ACTION_SHOW_POPUP: { | 751 case ExtensionAction::ACTION_SHOW_POPUP: { |
752 NSPoint arrowPoint = [self popupPointForBrowserAction:extension]; | 752 NSPoint arrowPoint = [self popupPointForBrowserAction:extension]; |
753 [ExtensionPopupController showURL:popupUrl | 753 [ExtensionPopupController showURL:popupUrl |
754 inBrowser:browser_ | 754 inBrowser:browser_ |
755 anchoredAt:arrowPoint | 755 anchoredAt:arrowPoint |
756 arrowLocation:info_bubble::kTopRight | 756 arrowLocation:info_bubble::kTopRight |
757 devMode:NO]; | 757 devMode:NO]; |
758 return YES; | 758 return YES; |
759 } | 759 } |
760 } | 760 } |
761 return NO; | 761 return NO; |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
870 const extensions::ExtensionList& toolbar_items = | 870 const extensions::ExtensionList& toolbar_items = |
871 toolbarModel_->toolbar_items(); | 871 toolbarModel_->toolbar_items(); |
872 if (index < toolbar_items.size()) { | 872 if (index < toolbar_items.size()) { |
873 const Extension* extension = toolbar_items[index].get(); | 873 const Extension* extension = toolbar_items[index].get(); |
874 return [buttons_ objectForKey:base::SysUTF8ToNSString(extension->id())]; | 874 return [buttons_ objectForKey:base::SysUTF8ToNSString(extension->id())]; |
875 } | 875 } |
876 return nil; | 876 return nil; |
877 } | 877 } |
878 | 878 |
879 @end | 879 @end |
OLD | NEW |