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

Unified Diff: ui/views/controls/menu/menu_runner.cc

Issue 59383003: Add the button style for combobox (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: warnings Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/controls/menu/menu_runner.h ('k') | ui/views/controls/menu/menu_runner_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/menu/menu_runner.cc
diff --git a/ui/views/controls/menu/menu_runner.cc b/ui/views/controls/menu/menu_runner.cc
index cc4f5022aee2f5081c7ce4f7742a31c6d69a364a..e254dbffc5519631e79bcc68964bcd423ff2e307 100644
--- a/ui/views/controls/menu/menu_runner.cc
+++ b/ui/views/controls/menu/menu_runner.cc
@@ -13,6 +13,7 @@
#include "ui/views/controls/menu/menu_controller_delegate.h"
#include "ui/views/controls/menu/menu_delegate.h"
#include "ui/views/controls/menu/menu_model_adapter.h"
+#include "ui/views/controls/menu/menu_runner_handler.h"
#include "ui/views/widget/widget.h"
#if defined(OS_WIN)
@@ -312,6 +313,11 @@ MenuRunner::RunResult MenuRunner::RunMenuAt(Widget* parent,
MenuItemView::AnchorPosition anchor,
ui::MenuSourceType source_type,
int32 types) {
+ if (runner_handler_.get()) {
+ return runner_handler_->RunMenuAt(parent, button, bounds, anchor,
+ source_type, types);
+ }
+
// The parent of the nested menu will have created a DisplayChangeListener, so
// we avoid creating a DisplayChangeListener if nested. Drop menus are
// transient, so we don't cancel in that case.
@@ -351,4 +357,9 @@ base::TimeDelta MenuRunner::closing_event_time() const {
return holder_->closing_event_time();
}
+void MenuRunner::SetRunnerHandler(
+ scoped_ptr<MenuRunnerHandler> runner_handler) {
+ runner_handler_ = runner_handler.Pass();
+}
+
} // namespace views
« no previous file with comments | « ui/views/controls/menu/menu_runner.h ('k') | ui/views/controls/menu/menu_runner_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698