| 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" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 | 99 |
| 100 // Listeners to call when the menu opens. | 100 // Listeners to call when the menu opens. |
| 101 base::ObserverList<views::MenuListener> menu_listeners_; | 101 base::ObserverList<views::MenuListener> menu_listeners_; |
| 102 | 102 |
| 103 // App model and menu. | 103 // App model and menu. |
| 104 // Note that the menu should be destroyed before the model it uses, so the | 104 // Note that the menu should be destroyed before the model it uses, so the |
| 105 // menu should be listed later. | 105 // menu should be listed later. |
| 106 scoped_ptr<AppMenuModel> menu_model_; | 106 scoped_ptr<AppMenuModel> menu_model_; |
| 107 scoped_ptr<AppMenu> menu_; | 107 scoped_ptr<AppMenu> menu_; |
| 108 | 108 |
| 109 // Used by ShowMenu() to detect when |this| has been deleted; see comments | |
| 110 // there. | |
| 111 bool* destroyed_; | |
| 112 | 109 |
| 113 // Any trailing margin to be applied. Used when the browser is in | 110 // Any trailing margin to be applied. Used when the browser is in |
| 114 // a maximized state to extend to the full window width. | 111 // a maximized state to extend to the full window width. |
| 115 int margin_trailing_; | 112 int margin_trailing_; |
| 116 | 113 |
| 117 // Controls the visual feedback for the button state. | 114 // Controls the visual feedback for the button state. |
| 118 scoped_ptr<views::InkDropDelegate> ink_drop_delegate_; | 115 scoped_ptr<views::InkDropDelegate> ink_drop_delegate_; |
| 119 | 116 |
| 120 // 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. |
| 121 base::WeakPtrFactory<AppMenuButton> weak_factory_; | 118 base::WeakPtrFactory<AppMenuButton> weak_factory_; |
| 122 | 119 |
| 123 DISALLOW_COPY_AND_ASSIGN(AppMenuButton); | 120 DISALLOW_COPY_AND_ASSIGN(AppMenuButton); |
| 124 }; | 121 }; |
| 125 | 122 |
| 126 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_APP_MENU_BUTTON_H_ | 123 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_APP_MENU_BUTTON_H_ |
| OLD | NEW |