Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(261)

Side by Side Diff: chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm

Issue 6125003: Make ExtensionBrowserEventRouter owned by ExtensionService.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/extensions/page_action_apitest.cc ('k') | chrome/browser/ui/cocoa/location_bar/page_action_decoration.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698