| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef VIEWS_CONTROLS_MENU_VIEW_MENU_DELEGATE_H_ | 5 #ifndef VIEWS_CONTROLS_MENU_VIEW_MENU_DELEGATE_H_ |
| 6 #define VIEWS_CONTROLS_MENU_VIEW_MENU_DELEGATE_H_ | 6 #define VIEWS_CONTROLS_MENU_VIEW_MENU_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "base/gfx/native_widget_types.h" | 8 #include "base/gfx/native_widget_types.h" |
| 9 | 9 |
| 10 namespace gfx { |
| 11 class Point; |
| 12 } |
| 13 |
| 10 namespace views { | 14 namespace views { |
| 11 | 15 |
| 12 class View; | 16 class View; |
| 13 | 17 |
| 14 //////////////////////////////////////////////////////////////////////////////// | 18 //////////////////////////////////////////////////////////////////////////////// |
| 15 // | 19 // |
| 16 // ViewMenuDelegate | 20 // ViewMenuDelegate |
| 17 // | 21 // |
| 18 // An interface that allows a component to tell a View about a menu that it | 22 // An interface that allows a component to tell a View about a menu that it |
| 19 // has constructed that the view can show (e.g. for MenuButton views, or as a | 23 // has constructed that the view can show (e.g. for MenuButton views, or as a |
| 20 // context menu.) | 24 // context menu.) |
| 21 // | 25 // |
| 22 //////////////////////////////////////////////////////////////////////////////// | 26 //////////////////////////////////////////////////////////////////////////////// |
| 23 class ViewMenuDelegate { | 27 class ViewMenuDelegate { |
| 24 public: | 28 public: |
| 25 // Create and show a menu at the specified position. Source is the view the | 29 // Create and show a menu at the specified position. Source is the view the |
| 26 // ViewMenuDelegate was set on. | 30 // ViewMenuDelegate was set on. |
| 27 virtual void RunMenu(View* source, | 31 virtual void RunMenu(View* source, |
| 28 const CPoint& pt, | 32 const gfx::Point& pt, |
| 29 gfx::NativeView hwnd) = 0; | 33 gfx::NativeView hwnd) = 0; |
| 30 }; | 34 }; |
| 31 | 35 |
| 32 } // namespace views | 36 } // namespace views |
| 33 | 37 |
| 34 #endif // VIEWS_CONTROLS_MENU_VIEW_MENU_DELEGATE_H_ | 38 #endif // VIEWS_CONTROLS_MENU_VIEW_MENU_DELEGATE_H_ |
| OLD | NEW |