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

Side by Side Diff: chrome/browser/ui/toolbar/action_box_button_controller.cc

Issue 11275088: Remove implicit scoped_refptr operator T* Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 8 years, 1 month 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
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/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 extensions::ExtensionSystem::Get(browser_->profile())-> 81 extensions::ExtensionSystem::Get(browser_->profile())->
82 extension_service(); 82 extension_service();
83 if (!browser_->profile()->IsOffTheRecord()) { 83 if (!browser_->profile()->IsOffTheRecord()) {
84 int next_share_intent_command_id = SHARE_COMMAND_FIRST; 84 int next_share_intent_command_id = SHARE_COMMAND_FIRST;
85 share_intent_service_ids_.clear(); 85 share_intent_service_ids_.clear();
86 const ExtensionSet* extension_set = extension_service->extensions(); 86 const ExtensionSet* extension_set = extension_service->extensions();
87 WebIntentsRegistry* intents_registry = 87 WebIntentsRegistry* intents_registry =
88 WebIntentsRegistryFactory::GetForProfile(browser_->profile()); 88 WebIntentsRegistryFactory::GetForProfile(browser_->profile());
89 for (ExtensionSet::const_iterator it = extension_set->begin(); 89 for (ExtensionSet::const_iterator it = extension_set->begin();
90 it != extension_set->end(); ++it) { 90 it != extension_set->end(); ++it) {
91 const extensions::Extension* extension = *it; 91 const extensions::Extension* extension = *it.get();
92 WebIntentsRegistry::IntentServiceList services; 92 WebIntentsRegistry::IntentServiceList services;
93 intents_registry->GetIntentServicesForExtensionFilter( 93 intents_registry->GetIntentServicesForExtensionFilter(
94 ASCIIToUTF16(kShareIntentAction), 94 ASCIIToUTF16(kShareIntentAction),
95 ASCIIToUTF16(kShareIntentMimeType), 95 ASCIIToUTF16(kShareIntentMimeType),
96 extension->id(), 96 extension->id(),
97 &services); 97 &services);
98 if (!services.empty()) { 98 if (!services.empty()) {
99 int command_id = next_share_intent_command_id++; 99 int command_id = next_share_intent_command_id++;
100 if (command_id > SHARE_COMMAND_LAST) 100 if (command_id > SHARE_COMMAND_LAST)
101 break; 101 break;
(...skipping 18 matching lines...) Expand all
120 } 120 }
121 } 121 }
122 122
123 // Add Extensions. 123 // Add Extensions.
124 next_extension_command_id_ = EXTENSION_COMMAND_FIRST; 124 next_extension_command_id_ = EXTENSION_COMMAND_FIRST;
125 extension_command_ids_.clear(); 125 extension_command_ids_.clear();
126 const extensions::ExtensionList& extensions = 126 const extensions::ExtensionList& extensions =
127 extension_service->toolbar_model()->action_box_menu_items(); 127 extension_service->toolbar_model()->action_box_menu_items();
128 for (extensions::ExtensionList::const_iterator it = extensions.begin(); 128 for (extensions::ExtensionList::const_iterator it = extensions.begin();
129 it != extensions.end(); ++it) { 129 it != extensions.end(); ++it) {
130 menu_model->AddExtension(**it, GetCommandIdForExtension(**it)); 130 menu_model->AddExtension(**it.get(), GetCommandIdForExtension(**it.get()));
131 } 131 }
132 132
133 // And show the menu. 133 // And show the menu.
134 delegate_->ShowMenu(menu_model.Pass()); 134 delegate_->ShowMenu(menu_model.Pass());
135 } 135 }
136 136
137 bool ActionBoxButtonController::IsCommandIdChecked(int command_id) const { 137 bool ActionBoxButtonController::IsCommandIdChecked(int command_id) const {
138 return false; 138 return false;
139 } 139 }
140 140
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 kShareIntentAction, 240 kShareIntentAction,
241 kShareIntentMimeType); 241 kShareIntentMimeType);
242 chrome::NavigateParams params(browser_->profile(), query_url, 242 chrome::NavigateParams params(browser_->profile(), query_url,
243 content::PAGE_TRANSITION_LINK); 243 content::PAGE_TRANSITION_LINK);
244 params.disposition = NEW_FOREGROUND_TAB; 244 params.disposition = NEW_FOREGROUND_TAB;
245 chrome::Navigate(&params); 245 chrome::Navigate(&params);
246 246
247 content::RecordAction(UserMetricsAction("ActionBox.FindShareHandlers")); 247 content::RecordAction(UserMetricsAction("ActionBox.FindShareHandlers"));
248 send_uma_share_command_count = true; 248 send_uma_share_command_count = true;
249 } 249 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc ('k') | chrome/browser/ui/toolbar/toolbar_model_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698