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

Unified Diff: chrome/browser/ui/views/toolbar/browser_action_view.cc

Issue 393943006: MacViews: Remove GetMenu() from MenuRunner. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix unit test compile Created 6 years, 5 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
« no previous file with comments | « chrome/browser/ui/views/toolbar/browser_action_view.h ('k') | ui/views/controls/combobox/combobox.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/toolbar/browser_action_view.cc
diff --git a/chrome/browser/ui/views/toolbar/browser_action_view.cc b/chrome/browser/ui/views/toolbar/browser_action_view.cc
index 0eb1931cc2a52d82d364533151c5c790a691a4e5..e1f48c283305108b660088a6549eea0c370611e3 100644
--- a/chrome/browser/ui/views/toolbar/browser_action_view.cc
+++ b/chrome/browser/ui/views/toolbar/browser_action_view.cc
@@ -110,7 +110,6 @@ BrowserActionButton::BrowserActionButton(const Extension* extension,
extension_(extension),
icon_factory_(browser->profile(), extension, browser_action_, this),
delegate_(delegate),
- context_menu_(NULL),
called_registered_extension_command_(false),
icon_observer_(NULL) {
SetHorizontalAlignment(gfx::ALIGN_CENTER);
@@ -140,8 +139,8 @@ BrowserActionButton::BrowserActionButton(const Extension* extension,
void BrowserActionButton::Destroy() {
MaybeUnregisterExtensionCommand(false);
- if (context_menu_) {
- context_menu_->Cancel();
+ if (menu_runner_) {
+ menu_runner_->Cancel();
base::MessageLoop::current()->DeleteSoon(FROM_HERE, this);
} else {
delete this;
@@ -207,7 +206,6 @@ void BrowserActionButton::ShowContextMenuForView(
menu_runner_.reset(
new views::MenuRunner(context_menu_contents.get(), run_types));
- context_menu_ = menu_runner_->GetMenu();
if (menu_runner_->RunMenuAt(parent,
NULL,
@@ -220,7 +218,6 @@ void BrowserActionButton::ShowContextMenuForView(
menu_runner_.reset();
SetButtonNotPushed();
- context_menu_ = NULL;
}
void BrowserActionButton::UpdateState() {
@@ -342,7 +339,7 @@ bool BrowserActionButton::OnMousePressed(const ui::MouseEvent& event) {
}
void BrowserActionButton::OnMouseReleased(const ui::MouseEvent& event) {
- if (IsPopup() || context_menu_) {
+ if (IsPopup() || menu_runner_) {
// TODO(erikkay) this never actually gets called (probably because of the
// loss of focus).
MenuButton::OnMouseReleased(event);
@@ -352,7 +349,7 @@ void BrowserActionButton::OnMouseReleased(const ui::MouseEvent& event) {
}
void BrowserActionButton::OnMouseExited(const ui::MouseEvent& event) {
- if (IsPopup() || context_menu_)
+ if (IsPopup() || menu_runner_)
MenuButton::OnMouseExited(event);
else
LabelButton::OnMouseExited(event);
« no previous file with comments | « chrome/browser/ui/views/toolbar/browser_action_view.h ('k') | ui/views/controls/combobox/combobox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698