summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-08 21:00:16 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-08 21:00:16 +0000
commitd30e8c59447987afbbd59aac74e927e9b4ed86b0 (patch)
treedc7dfe0f92cf0e370608ad60492538c87a5f7105 /views
parent4bd23f35c4b4b7eab1796170789a8f00e7984972 (diff)
downloadchromium_src-d30e8c59447987afbbd59aac74e927e9b4ed86b0.zip
chromium_src-d30e8c59447987afbbd59aac74e927e9b4ed86b0.tar.gz
chromium_src-d30e8c59447987afbbd59aac74e927e9b4ed86b0.tar.bz2
forgot this file in last CL
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17896 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/controls/menu/menu_wrapper.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/views/controls/menu/menu_wrapper.h b/views/controls/menu/menu_wrapper.h
new file mode 100644
index 0000000..f418703
--- /dev/null
+++ b/views/controls/menu/menu_wrapper.h
@@ -0,0 +1,44 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
+// source code is governed by a BSD-style license that can be found in the
+// LICENSE file.
+
+#ifndef VIEWS_CONTROLS_MENU_MENU_WRAPPER_H_
+#define VIEWS_CONTROLS_MENU_MENU_WRAPPER_H_
+
+#include "base/gfx/native_widget_types.h"
+
+namespace gfx {
+class Point;
+}
+
+namespace views {
+
+class Menu2;
+
+// An interface that wraps an object that implements a menu.
+class MenuWrapper {
+ public:
+ virtual ~MenuWrapper() {}
+
+ // Runs the menu at the specified point. This may or may not block depending
+ // on the platform.
+ virtual void RunMenuAt(const gfx::Point& point, int alignment) = 0;
+
+ // Called when the model supplying data to this menu has changed, and the menu
+ // must be rebuilt.
+ virtual void Rebuild() = 0;
+
+ // Called when the states of the items in the menu must be updated from the
+ // model.
+ virtual void UpdateStates() = 0;
+
+ // Retrieve a native menu handle.
+ virtual gfx::NativeMenu GetNativeMenu() const = 0;
+
+ // Creates the appropriate instance of this wrapper for the current platform.
+ static MenuWrapper* CreateWrapper(Menu2* menu);
+};
+
+} // namespace views
+
+#endif // VIEWS_CONTROLS_MENU_MENU_WRAPPER_H_