OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_BUTTON_BUTTON_DROPDOWN_H_ | 5 #ifndef VIEWS_CONTROLS_BUTTON_BUTTON_DROPDOWN_H_ |
6 #define VIEWS_CONTROLS_BUTTON_BUTTON_DROPDOWN_H_ | 6 #define VIEWS_CONTROLS_BUTTON_BUTTON_DROPDOWN_H_ |
7 | 7 |
8 #include "base/task.h" | 8 #include "base/task.h" |
9 #include "views/controls/button/image_button.h" | 9 #include "views/controls/button/image_button.h" |
10 #include "views/controls/menu/menu.h" | 10 #include "views/controls/menu/menu.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 virtual bool OnMouseDragged(const MouseEvent& e); | 36 virtual bool OnMouseDragged(const MouseEvent& e); |
37 | 37 |
38 // Overridden from View. Used to display the right-click menu, as triggered | 38 // Overridden from View. Used to display the right-click menu, as triggered |
39 // by the keyboard, for instance. Using the member function ShowDropDownMenu | 39 // by the keyboard, for instance. Using the member function ShowDropDownMenu |
40 // for the actual display. | 40 // for the actual display. |
41 virtual void ShowContextMenu(int x, | 41 virtual void ShowContextMenu(int x, |
42 int y, | 42 int y, |
43 bool is_mouse_gesture); | 43 bool is_mouse_gesture); |
44 | 44 |
45 // Internal function to show the dropdown menu | 45 // Internal function to show the dropdown menu |
46 void ShowDropDownMenu(HWND window); | 46 void ShowDropDownMenu(gfx::NativeView window); |
47 | 47 |
48 // Specifies who to delegate populating the menu | 48 // Specifies who to delegate populating the menu |
49 Menu::Delegate* menu_delegate_; | 49 Menu::Delegate* menu_delegate_; |
50 | 50 |
51 // Y position of mouse when left mouse button is pressed | 51 // Y position of mouse when left mouse button is pressed |
52 int y_position_on_lbuttondown_; | 52 int y_position_on_lbuttondown_; |
53 | 53 |
54 // A factory for tasks that show the dropdown context menu for the button. | 54 // A factory for tasks that show the dropdown context menu for the button. |
55 ScopedRunnableMethodFactory<ButtonDropDown> show_menu_factory_; | 55 ScopedRunnableMethodFactory<ButtonDropDown> show_menu_factory_; |
56 | 56 |
57 DISALLOW_COPY_AND_ASSIGN(ButtonDropDown); | 57 DISALLOW_COPY_AND_ASSIGN(ButtonDropDown); |
58 }; | 58 }; |
59 | 59 |
60 } // namespace views | 60 } // namespace views |
61 | 61 |
62 #endif // VIEWS_CONTROLS_BUTTON_BUTTON_DROPDOWN_H_ | 62 #endif // VIEWS_CONTROLS_BUTTON_BUTTON_DROPDOWN_H_ |
OLD | NEW |