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

Side by Side Diff: chrome/browser/ui/views/location_bar/page_action_image_view.cc

Issue 11820041: Remove profile-keyed factory boilerplates. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 7 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
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/views/location_bar/page_action_image_view.h" 5 #include "chrome/browser/ui/views/location_bar/page_action_image_view.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/extensions/api/commands/command_service.h" 8 #include "chrome/browser/extensions/api/commands/command_service.h"
9 #include "chrome/browser/extensions/api/commands/command_service_factory.h"
10 #include "chrome/browser/extensions/extension_action.h" 9 #include "chrome/browser/extensions/extension_action.h"
11 #include "chrome/browser/extensions/extension_action_icon_factory.h" 10 #include "chrome/browser/extensions/extension_action_icon_factory.h"
12 #include "chrome/browser/extensions/extension_action_manager.h" 11 #include "chrome/browser/extensions/extension_action_manager.h"
13 #include "chrome/browser/extensions/extension_context_menu_model.h" 12 #include "chrome/browser/extensions/extension_context_menu_model.h"
14 #include "chrome/browser/extensions/extension_service.h" 13 #include "chrome/browser/extensions/extension_service.h"
15 #include "chrome/browser/extensions/extension_tab_util.h" 14 #include "chrome/browser/extensions/extension_tab_util.h"
16 #include "chrome/browser/extensions/location_bar_controller.h" 15 #include "chrome/browser/extensions/location_bar_controller.h"
17 #include "chrome/browser/extensions/tab_helper.h" 16 #include "chrome/browser/extensions/tab_helper.h"
18 #include "chrome/browser/platform_util.h" 17 #include "chrome/browser/platform_util.h"
19 #include "chrome/browser/profiles/profile.h" 18 #include "chrome/browser/profiles/profile.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 GetExtensionById(page_action->extension_id(), false); 52 GetExtensionById(page_action->extension_id(), false);
54 DCHECK(extension); 53 DCHECK(extension);
55 54
56 icon_factory_.reset( 55 icon_factory_.reset(
57 new ExtensionActionIconFactory(extension, page_action, this)); 56 new ExtensionActionIconFactory(extension, page_action, this));
58 57
59 set_accessibility_focusable(true); 58 set_accessibility_focusable(true);
60 set_context_menu_controller(this); 59 set_context_menu_controller(this);
61 60
62 extensions::CommandService* command_service = 61 extensions::CommandService* command_service =
63 extensions::CommandServiceFactory::GetForProfile( 62 extensions::CommandService::Get(browser_->profile());
64 browser_->profile());
65 extensions::Command page_action_command; 63 extensions::Command page_action_command;
66 if (command_service->GetPageActionCommand( 64 if (command_service->GetPageActionCommand(
67 extension->id(), 65 extension->id(),
68 extensions::CommandService::ACTIVE_ONLY, 66 extensions::CommandService::ACTIVE_ONLY,
69 &page_action_command, 67 &page_action_command,
70 NULL)) { 68 NULL)) {
71 page_action_keybinding_.reset( 69 page_action_keybinding_.reset(
72 new ui::Accelerator(page_action_command.accelerator())); 70 new ui::Accelerator(page_action_command.accelerator()));
73 owner_->GetFocusManager()->RegisterAccelerator( 71 owner_->GetFocusManager()->RegisterAccelerator(
74 *page_action_keybinding_.get(), 72 *page_action_keybinding_.get(),
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 277
280 popup_ = ExtensionPopup::ShowPopup(popup_url, browser_, this, arrow_location, 278 popup_ = ExtensionPopup::ShowPopup(popup_url, browser_, this, arrow_location,
281 show_action); 279 show_action);
282 popup_->GetWidget()->AddObserver(this); 280 popup_->GetWidget()->AddObserver(this);
283 } 281 }
284 282
285 void PageActionImageView::HidePopup() { 283 void PageActionImageView::HidePopup() {
286 if (popup_) 284 if (popup_)
287 popup_->GetWidget()->Close(); 285 popup_->GetWidget()->Close();
288 } 286 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698