summaryrefslogtreecommitdiffstats
path: root/chrome/views/controls/menu/view_menu_delegate.h
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/views/controls/menu/view_menu_delegate.h')
-rw-r--r--chrome/views/controls/menu/view_menu_delegate.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/chrome/views/controls/menu/view_menu_delegate.h b/chrome/views/controls/menu/view_menu_delegate.h
new file mode 100644
index 0000000..3f8f190
--- /dev/null
+++ b/chrome/views/controls/menu/view_menu_delegate.h
@@ -0,0 +1,34 @@
+// Copyright (c) 2006-2008 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 CHROME_VIEWS_CONTROLS_MENU_VIEW_MENU_DELEGATE_H_
+#define CHROME_VIEWS_CONTROLS_MENU_VIEW_MENU_DELEGATE_H_
+
+#include "base/gfx/native_widget_types.h"
+
+namespace views {
+
+class View;
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// ViewMenuDelegate
+//
+// An interface that allows a component to tell a View about a menu that it
+// has constructed that the view can show (e.g. for MenuButton views, or as a
+// context menu.)
+//
+////////////////////////////////////////////////////////////////////////////////
+class ViewMenuDelegate {
+ public:
+ // Create and show a menu at the specified position. Source is the view the
+ // ViewMenuDelegate was set on.
+ virtual void RunMenu(View* source,
+ const CPoint& pt,
+ gfx::NativeView hwnd) = 0;
+};
+
+} // namespace views
+
+#endif // CHROME_VIEWS_CONTROLS_MENU_VIEW_MENU_DELEGATE_H_