| 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_APP_MENU_BUTTON_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_TOOLBAR_APP_MENU_BUTTON_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_TOOLBAR_APP_MENU_BUTTON_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_TOOLBAR_APP_MENU_BUTTON_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| 11 #include "chrome/browser/ui/toolbar/wrench_icon_painter.h" | 11 #include "chrome/browser/ui/toolbar/wrench_icon_painter.h" |
| 12 #include "ui/views/animation/ink_drop_host.h" | 12 #include "ui/views/animation/ink_drop_host.h" |
| 13 #include "ui/views/controls/button/menu_button.h" | 13 #include "ui/views/controls/button/menu_button.h" |
| 14 #include "ui/views/controls/button/menu_button_listener.h" | 14 #include "ui/views/controls/button/menu_button_listener.h" |
| 15 #include "ui/views/view.h" | 15 #include "ui/views/view.h" |
| 16 | 16 |
| 17 class AppMenu; | 17 class AppMenu; |
| 18 class WrenchMenuModel; | 18 class AppMenuModel; |
| 19 | 19 |
| 20 namespace views { | 20 namespace views { |
| 21 class InkDropAnimationController; | 21 class InkDropAnimationController; |
| 22 class LabelButtonBorder; | 22 class LabelButtonBorder; |
| 23 class MenuListener; | 23 class MenuListener; |
| 24 } | 24 } |
| 25 | 25 |
| 26 class ToolbarView; | 26 class ToolbarView; |
| 27 | 27 |
| 28 class AppMenuButton : public views::InkDropHost, | 28 class AppMenuButton : public views::InkDropHost, |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 // Whether or not we should allow dragging extension icons onto this button | 100 // Whether or not we should allow dragging extension icons onto this button |
| 101 // (in order to open the overflow in the app menu). | 101 // (in order to open the overflow in the app menu). |
| 102 bool allow_extension_dragging_; | 102 bool allow_extension_dragging_; |
| 103 | 103 |
| 104 // Listeners to call when the menu opens. | 104 // Listeners to call when the menu opens. |
| 105 base::ObserverList<views::MenuListener> menu_listeners_; | 105 base::ObserverList<views::MenuListener> menu_listeners_; |
| 106 | 106 |
| 107 // App model and menu. | 107 // App model and menu. |
| 108 // Note that the menu should be destroyed before the model it uses, so the | 108 // Note that the menu should be destroyed before the model it uses, so the |
| 109 // menu should be listed later. | 109 // menu should be listed later. |
| 110 scoped_ptr<WrenchMenuModel> menu_model_; | 110 scoped_ptr<AppMenuModel> menu_model_; |
| 111 scoped_ptr<AppMenu> menu_; | 111 scoped_ptr<AppMenu> menu_; |
| 112 | 112 |
| 113 // Used by ShowMenu() to detect when |this| has been deleted; see comments | 113 // Used by ShowMenu() to detect when |this| has been deleted; see comments |
| 114 // there. | 114 // there. |
| 115 bool* destroyed_; | 115 bool* destroyed_; |
| 116 | 116 |
| 117 // Used to spawn weak pointers for delayed tasks to open the overflow menu. | 117 // Used to spawn weak pointers for delayed tasks to open the overflow menu. |
| 118 base::WeakPtrFactory<AppMenuButton> weak_factory_; | 118 base::WeakPtrFactory<AppMenuButton> weak_factory_; |
| 119 | 119 |
| 120 DISALLOW_COPY_AND_ASSIGN(AppMenuButton); | 120 DISALLOW_COPY_AND_ASSIGN(AppMenuButton); |
| 121 }; | 121 }; |
| 122 | 122 |
| 123 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_APP_MENU_BUTTON_H_ | 123 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_APP_MENU_BUTTON_H_ |
| OLD | NEW |