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

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

Issue 331993009: MacViews: Run native Cocoa context menus to support Services. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add VIEWS_EXPORT for unit test access 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
Index: ui/views/controls/menu/menu_runner.h
diff --git a/ui/views/controls/menu/menu_runner.h b/ui/views/controls/menu/menu_runner.h
index 824afdf8d4b52a37c7a37eb4bc8f36d67ebd8aa4..7bd0448d35cb6ac79cb72ac928ad4c9137b597ae 100644
--- a/ui/views/controls/menu/menu_runner.h
+++ b/ui/views/controls/menu/menu_runner.h
@@ -34,7 +34,7 @@ class Widget;
namespace internal {
class DisplayChangeListener;
-class MenuRunnerImpl;
+class MenuRunnerImplInterface;
}
namespace test {
@@ -93,8 +93,9 @@ class VIEWS_EXPORT MenuRunner {
};
// Creates a new MenuRunner.
- explicit MenuRunner(ui::MenuModel* menu_model);
- explicit MenuRunner(MenuItemView* menu);
+ // |run_types| is a bitmask of RunTypes.
+ MenuRunner(ui::MenuModel* menu_model, int32 run_types);
+ MenuRunner(MenuItemView* menu, int32 run_types);
~MenuRunner();
// Returns the menu.
@@ -105,8 +106,8 @@ class VIEWS_EXPORT MenuRunner {
// MenuDelegate::GetSiblingMenu.
void OwnMenu(MenuItemView* menu);
- // Runs the menu. |types| is a bitmask of RunTypes. If this returns
- // MENU_DELETED the method is returning because the MenuRunner was deleted.
+ // Runs the menu. If this returns MENU_DELETED the method is returning
+ // because the MenuRunner was deleted.
// Typically callers should NOT do any processing if this returns
// MENU_DELETED.
// If |anchor| uses a |BUBBLE_..| type, the bounds will get determined by
@@ -115,8 +116,7 @@ class VIEWS_EXPORT MenuRunner {
MenuButton* button,
const gfx::Rect& bounds,
MenuAnchorPosition anchor,
- ui::MenuSourceType source_type,
- int32 types) WARN_UNUSED_RESULT;
+ ui::MenuSourceType source_type) WARN_UNUSED_RESULT;
// Returns true if we're in a nested message loop running the menu.
bool IsRunning() const;
@@ -133,9 +133,10 @@ class VIEWS_EXPORT MenuRunner {
// Sets an implementation of RunMenuAt. This is intended to be used at test.
void SetRunnerHandler(scoped_ptr<MenuRunnerHandler> runner_handler);
- scoped_ptr<MenuModelAdapter> menu_model_adapter_;
+ const int32 run_types_;
- internal::MenuRunnerImpl* holder_;
+ // We own this. No scoped_ptr because it is destroyed by calling Release().
+ internal::MenuRunnerImplInterface* holder_;
sky 2014/07/14 21:02:22 holder_ was always a poor name. Maybe impl_?
Andre 2014/07/14 22:59:42 Done.
// An implementation of RunMenuAt. This is usually NULL and ignored. If this
// is not NULL, this implementation will be used.
@@ -164,7 +165,7 @@ class DisplayChangeListener {
DisplayChangeListener() {}
};
-}
+} // namespace internal
} // namespace views

Powered by Google App Engine
This is Rietveld 408576698