| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_BUTTON_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_BUTTON_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_BUTTON_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_BUTTON_H_ |
| 7 | 7 |
| 8 #include "ui/views/context_menu_controller.h" | 8 #include "ui/views/context_menu_controller.h" |
| 9 #include "ui/views/controls/button/button.h" | 9 #include "ui/views/controls/button/button.h" |
| 10 #include "ui/views/controls/button/label_button.h" | 10 #include "ui/views/controls/button/label_button.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 // Set up basic mouseover border behavior. | 30 // Set up basic mouseover border behavior. |
| 31 // Should be called before first paint. | 31 // Should be called before first paint. |
| 32 void Init(); | 32 void Init(); |
| 33 | 33 |
| 34 // Methods for handling ButtonDropDown-style menus. | 34 // Methods for handling ButtonDropDown-style menus. |
| 35 void ClearPendingMenu(); | 35 void ClearPendingMenu(); |
| 36 bool IsMenuShowing() const; | 36 bool IsMenuShowing() const; |
| 37 | 37 |
| 38 // views::LabelButton: | 38 // views::LabelButton: |
| 39 virtual gfx::Size GetPreferredSize() OVERRIDE; | 39 virtual gfx::Size GetPreferredSize() const OVERRIDE; |
| 40 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; | 40 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; |
| 41 virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE; | 41 virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE; |
| 42 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; | 42 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; |
| 43 // Showing the drop down results in a MouseCaptureLost, we need to ignore it. | 43 // Showing the drop down results in a MouseCaptureLost, we need to ignore it. |
| 44 virtual void OnMouseCaptureLost() OVERRIDE; | 44 virtual void OnMouseCaptureLost() OVERRIDE; |
| 45 virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE; | 45 virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE; |
| 46 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; | 46 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; |
| 47 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; | 47 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; |
| 48 | 48 |
| 49 // views::ContextMenuController: | 49 // views::ContextMenuController: |
| (...skipping 27 matching lines...) Expand all Loading... |
| 77 // Menu runner to display drop down menu. | 77 // Menu runner to display drop down menu. |
| 78 scoped_ptr<views::MenuRunner> menu_runner_; | 78 scoped_ptr<views::MenuRunner> menu_runner_; |
| 79 | 79 |
| 80 // A factory for tasks that show the dropdown context menu for the button. | 80 // A factory for tasks that show the dropdown context menu for the button. |
| 81 base::WeakPtrFactory<ToolbarButton> show_menu_factory_; | 81 base::WeakPtrFactory<ToolbarButton> show_menu_factory_; |
| 82 | 82 |
| 83 DISALLOW_COPY_AND_ASSIGN(ToolbarButton); | 83 DISALLOW_COPY_AND_ASSIGN(ToolbarButton); |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_BUTTON_H_ | 86 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_BUTTON_H_ |
| OLD | NEW |