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

Side by Side Diff: chrome/browser/views/extensions/extension_action_context_menu.cc

Issue 501136: Merge 34812 - Add the rightclick context menu for Browser actions and Page... (Closed) Base URL: svn://chrome-svn/chrome/branches/249/src/
Patch Set: Created 11 years 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
(Empty)
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/views/extensions/extension_action_context_menu.h"
6
7 #include "chrome/browser/browser.h"
8 #include "chrome/browser/browser_list.h"
9 #include "chrome/browser/extensions/extensions_service.h"
10 #include "chrome/browser/profile.h"
11
12 ExtensionActionContextMenu::ExtensionActionContextMenu()
13 : extension_(NULL) {
14 }
15
16 ExtensionActionContextMenu::~ExtensionActionContextMenu() {
17 }
18
19 void ExtensionActionContextMenu::Run(Extension* extension,
20 const gfx::Point& point) {
21 extension_ = extension;
22
23 context_menu_contents_.reset(
24 new ExtensionActionContextMenuModel(extension, this));
25 context_menu_menu_.reset(new views::Menu2(context_menu_contents_.get()));
26 context_menu_menu_->RunContextMenuAt(point);
27 }
28
29 void ExtensionActionContextMenu::InstallUIProceed() {
30 // TODO(finnur): GetLastActive returns NULL in unit tests.
31 Browser* browser = BrowserList::GetLastActive();
32 std::string id = extension_->id();
33 browser->profile()->GetExtensionsService()->UninstallExtension(id, false);
34 }
OLDNEW
« no previous file with comments | « chrome/browser/views/extensions/extension_action_context_menu.h ('k') | chrome/browser/views/location_bar_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698