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

Unified Diff: chrome/browser/ui/views/location_bar/page_action_image_view.cc

Issue 9703099: Revert 126959 - Re-factor location bar/toolbar code to get rid of the browser dependency. This CL i… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/location_bar/page_action_image_view.cc
===================================================================
--- chrome/browser/ui/views/location_bar/page_action_image_view.cc (revision 127082)
+++ chrome/browser/ui/views/location_bar/page_action_image_view.cc (working copy)
@@ -27,17 +27,16 @@
using content::WebContents;
PageActionImageView::PageActionImageView(LocationBarView* owner,
- ExtensionAction* page_action,
- Browser* browser)
+ ExtensionAction* page_action)
: owner_(owner),
page_action_(page_action),
- browser_(browser),
ALLOW_THIS_IN_INITIALIZER_LIST(tracker_(this)),
current_tab_id_(-1),
preview_enabled_(false),
popup_(NULL) {
- const Extension* extension = owner_->profile()->GetExtensionService()->
- GetExtensionById(page_action->extension_id(), false);
+ const Extension* extension = owner_->browser()->profile()->
+ GetExtensionService()->GetExtensionById(page_action->extension_id(),
+ false);
DCHECK(extension);
// Load all the icons declared in the manifest. This is the contents of the
@@ -56,7 +55,7 @@
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED,
content::Source<Profile>(
- owner_->profile()->GetOriginalProfile()));
+ owner_->browser()->profile()->GetOriginalProfile()));
set_accessibility_focusable(true);
@@ -106,13 +105,13 @@
popup_ = ExtensionPopup::ShowPopup(
page_action_->GetPopupUrl(current_tab_id_),
- browser_,
+ owner_->browser(),
this,
arrow_location,
inspect_with_devtools);
popup_->GetWidget()->AddObserver(this);
} else {
- Profile* profile = owner_->profile();
+ Profile* profile = owner_->browser()->profile();
ExtensionService* service = profile->GetExtensionService();
service->browser_event_router()->PageActionExecuted(
profile, page_action_->extension_id(), page_action_->id(),
@@ -160,13 +159,14 @@
void PageActionImageView::ShowContextMenu(const gfx::Point& p,
bool is_mouse_gesture) {
- const Extension* extension = owner_->profile()->GetExtensionService()->
- GetExtensionById(page_action()->extension_id(), false);
+ const Extension* extension = owner_->browser()->profile()->
+ GetExtensionService()->GetExtensionById(page_action()->extension_id(),
+ false);
if (!extension->ShowConfigureContextMenus())
return;
scoped_refptr<ExtensionContextMenuModel> context_menu_model(
- new ExtensionContextMenuModel(extension, browser_, this));
+ new ExtensionContextMenuModel(extension, owner_->browser(), this));
views::MenuModelAdapter menu_model_adapter(context_menu_model.get());
menu_runner_.reset(new views::MenuRunner(menu_model_adapter.CreateMenu()));
gfx::Point screen_loc;
« no previous file with comments | « chrome/browser/ui/views/location_bar/page_action_image_view.h ('k') | chrome/browser/ui/views/omnibox/omnibox_view_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698