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

Side by Side Diff: chrome/browser/ui/toolbar/action_box_button_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/ui/toolbar/action_box_button_controller.h" 5 #include "chrome/browser/ui/toolbar/action_box_button_controller.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/app/chrome_command_ids.h" 10 #include "chrome/app/chrome_command_ids.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 rb.GetNativeImageNamed(IDR_MOBILE)); 80 rb.GetNativeImageNamed(IDR_MOBILE));
81 } 81 }
82 82
83 ExtensionService* extension_service = 83 ExtensionService* extension_service =
84 extensions::ExtensionSystem::Get(browser_->profile())-> 84 extensions::ExtensionSystem::Get(browser_->profile())->
85 extension_service(); 85 extension_service();
86 if (extension_service) { 86 if (extension_service) {
87 const ExtensionSet* extensions = extension_service->extensions(); 87 const ExtensionSet* extensions = extension_service->extensions();
88 for (ExtensionSet::const_iterator it = extensions->begin(); 88 for (ExtensionSet::const_iterator it = extensions->begin();
89 it != extensions->end(); ++it) { 89 it != extensions->end(); ++it) {
90 const extensions::Extension* extension = *it; 90 const extensions::Extension* extension = it->get();
91 if (ActionInfo::GetPageLauncherInfo(extension)) { 91 if (ActionInfo::GetPageLauncherInfo(extension)) {
92 int command_id = GetCommandIdForExtension(*extension); 92 int command_id = GetCommandIdForExtension(*extension);
93 menu_model->AddExtension(*extension, command_id); 93 menu_model->AddExtension(*extension, command_id);
94 } 94 }
95 } 95 }
96 } 96 }
97 return menu_model.Pass(); 97 return menu_model.Pass();
98 } 98 }
99 99
100 void ActionBoxButtonController::OnButtonClicked() { 100 void ActionBoxButtonController::OnButtonClicked() {
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 for (ExtensionIdCommandMap::iterator it = extension_command_ids_.begin(); 185 for (ExtensionIdCommandMap::iterator it = extension_command_ids_.begin();
186 it != extension_command_ids_.end();) { 186 it != extension_command_ids_.end();) {
187 if (it->second== extension->id()) 187 if (it->second== extension->id())
188 extension_command_ids_.erase(it++); 188 extension_command_ids_.erase(it++);
189 else 189 else
190 ++it; 190 ++it;
191 } 191 }
192 // TODO(kalman): if there's a menu open, remove it from that too. 192 // TODO(kalman): if there's a menu open, remove it from that too.
193 // We may also want to listen to EXTENSION_LOADED to do the opposite. 193 // We may also want to listen to EXTENSION_LOADED to do the opposite.
194 } 194 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/tabs/tab_utils.cc ('k') | chrome/browser/ui/webui/extensions/command_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698