OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "browser_actions_controller.h" | 5 #import "browser_actions_controller.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "app/mac/nsimage_cache.h" | 10 #include "app/mac/nsimage_cache.h" |
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
734 [popup close]; | 734 [popup close]; |
735 return; | 735 return; |
736 } | 736 } |
737 NSPoint arrowPoint = [self popupPointForBrowserAction:[button extension]]; | 737 NSPoint arrowPoint = [self popupPointForBrowserAction:[button extension]]; |
738 [ExtensionPopupController showURL:popupUrl | 738 [ExtensionPopupController showURL:popupUrl |
739 inBrowser:browser_ | 739 inBrowser:browser_ |
740 anchoredAt:arrowPoint | 740 anchoredAt:arrowPoint |
741 arrowLocation:info_bubble::kTopRight | 741 arrowLocation:info_bubble::kTopRight |
742 devMode:NO]; | 742 devMode:NO]; |
743 } else { | 743 } else { |
744 ExtensionBrowserEventRouter::GetInstance()->BrowserActionExecuted( | 744 ExtensionService* service = profile_->GetExtensionService(); |
| 745 service->browser_event_router()->BrowserActionExecuted( |
745 profile_, action->extension_id(), browser_); | 746 profile_, action->extension_id(), browser_); |
746 } | 747 } |
747 } | 748 } |
748 | 749 |
749 - (BOOL)shouldDisplayBrowserAction:(const Extension*)extension { | 750 - (BOOL)shouldDisplayBrowserAction:(const Extension*)extension { |
750 // Only display incognito-enabled extensions while in incognito mode. | 751 // Only display incognito-enabled extensions while in incognito mode. |
751 return (!profile_->IsOffTheRecord() || | 752 return (!profile_->IsOffTheRecord() || |
752 profile_->GetExtensionService()->IsIncognitoEnabled(extension)); | 753 profile_->GetExtensionService()->IsIncognitoEnabled(extension)); |
753 } | 754 } |
754 | 755 |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
857 if (profile_->IsOffTheRecord()) | 858 if (profile_->IsOffTheRecord()) |
858 index = toolbarModel_->IncognitoIndexToOriginal(index); | 859 index = toolbarModel_->IncognitoIndexToOriginal(index); |
859 if (index < toolbarModel_->size()) { | 860 if (index < toolbarModel_->size()) { |
860 const Extension* extension = toolbarModel_->GetExtensionByIndex(index); | 861 const Extension* extension = toolbarModel_->GetExtensionByIndex(index); |
861 return [buttons_ objectForKey:base::SysUTF8ToNSString(extension->id())]; | 862 return [buttons_ objectForKey:base::SysUTF8ToNSString(extension->id())]; |
862 } | 863 } |
863 return nil; | 864 return nil; |
864 } | 865 } |
865 | 866 |
866 @end | 867 @end |
OLD | NEW |