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

Side by Side Diff: chrome/browser/extensions/page_action_controller.cc

Issue 15984016: Call scoped_refptr<T>::get() rather than relying on implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 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) 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 #include "chrome/browser/extensions/page_action_controller.h" 5 #include "chrome/browser/extensions/page_action_controller.h"
6 6
7 #include "chrome/browser/extensions/browser_event_router.h" 7 #include "chrome/browser/extensions/browser_event_router.h"
8 #include "chrome/browser/extensions/component_loader.h" 8 #include "chrome/browser/extensions/component_loader.h"
9 #include "chrome/browser/extensions/extension_action.h" 9 #include "chrome/browser/extensions/extension_action.h"
10 #include "chrome/browser/extensions/extension_action_manager.h" 10 #include "chrome/browser/extensions/extension_action_manager.h"
(...skipping 23 matching lines...) Expand all
34 return std::vector<ExtensionAction*>(); 34 return std::vector<ExtensionAction*>();
35 35
36 // Accumulate the list of all page actions to display. 36 // Accumulate the list of all page actions to display.
37 std::vector<ExtensionAction*> current_actions; 37 std::vector<ExtensionAction*> current_actions;
38 38
39 ExtensionActionManager* extension_action_manager = 39 ExtensionActionManager* extension_action_manager =
40 ExtensionActionManager::Get(profile()); 40 ExtensionActionManager::Get(profile());
41 41
42 for (ExtensionSet::const_iterator i = service->extensions()->begin(); 42 for (ExtensionSet::const_iterator i = service->extensions()->begin();
43 i != service->extensions()->end(); ++i) { 43 i != service->extensions()->end(); ++i) {
44 ExtensionAction* action = extension_action_manager->GetPageAction(**i); 44 ExtensionAction* action =
45 extension_action_manager->GetPageAction(*i->get());
45 if (action) 46 if (action)
46 current_actions.push_back(action); 47 current_actions.push_back(action);
47 } 48 }
48 49
49 return current_actions; 50 return current_actions;
50 } 51 }
51 52
52 LocationBarController::Action PageActionController::OnClicked( 53 LocationBarController::Action PageActionController::OnClicked(
53 const std::string& extension_id, int mouse_button) { 54 const std::string& extension_id, int mouse_button) {
54 ExtensionService* service = GetExtensionService(); 55 ExtensionService* service = GetExtensionService();
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 111
111 Profile* PageActionController::profile() const { 112 Profile* PageActionController::profile() const {
112 return Profile::FromBrowserContext(web_contents()->GetBrowserContext()); 113 return Profile::FromBrowserContext(web_contents()->GetBrowserContext());
113 } 114 }
114 115
115 ExtensionService* PageActionController::GetExtensionService() const { 116 ExtensionService* PageActionController::GetExtensionService() const {
116 return ExtensionSystem::Get(profile())->extension_service(); 117 return ExtensionSystem::Get(profile())->extension_service();
117 } 118 }
118 119
119 } // namespace extensions 120 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/menu_manager_unittest.cc ('k') | chrome/browser/extensions/permissions_updater.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698