| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_EXTENSION_TOOLBAR_MENU_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_TOOLBAR_EXTENSION_TOOLBAR_MENU_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_TOOLBAR_EXTENSION_TOOLBAR_MENU_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_TOOLBAR_EXTENSION_TOOLBAR_MENU_VIEW_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/scoped_observer.h" | 10 #include "base/scoped_observer.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 // In the event that the app menu was opened for an Extension Action drag-and- | 26 // In the event that the app menu was opened for an Extension Action drag-and- |
| 27 // drop, this will also close the menu upon completion. | 27 // drop, this will also close the menu upon completion. |
| 28 class ExtensionToolbarMenuView : public views::ScrollView, | 28 class ExtensionToolbarMenuView : public views::ScrollView, |
| 29 public ToolbarActionsBarObserver { | 29 public ToolbarActionsBarObserver { |
| 30 public: | 30 public: |
| 31 ExtensionToolbarMenuView(Browser* browser, | 31 ExtensionToolbarMenuView(Browser* browser, |
| 32 AppMenu* app_menu, | 32 AppMenu* app_menu, |
| 33 views::MenuItemView* menu_item); | 33 views::MenuItemView* menu_item); |
| 34 ~ExtensionToolbarMenuView() override; | 34 ~ExtensionToolbarMenuView() override; |
| 35 | 35 |
| 36 // Returns whether the app menu should show this view. This is true when | |
| 37 // either |container_| has icons to display or the menu was opened for a drag- | |
| 38 // and-drop operation. | |
| 39 bool ShouldShow(); | |
| 40 | |
| 41 // views::View: | 36 // views::View: |
| 42 gfx::Size GetPreferredSize() const override; | 37 gfx::Size GetPreferredSize() const override; |
| 43 int GetHeightForWidth(int width) const override; | 38 int GetHeightForWidth(int width) const override; |
| 44 void Layout() override; | 39 void Layout() override; |
| 45 | 40 |
| 46 BrowserActionsContainer* container_for_testing() { | 41 BrowserActionsContainer* container_for_testing() { |
| 47 return container_; | 42 return container_; |
| 48 } | 43 } |
| 49 | 44 |
| 50 // Sets the time delay the app menu takes to close after a drag-and-drop | 45 // Sets the time delay the app menu takes to close after a drag-and-drop |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 | 78 |
| 84 ScopedObserver<ToolbarActionsBar, ToolbarActionsBarObserver> | 79 ScopedObserver<ToolbarActionsBar, ToolbarActionsBarObserver> |
| 85 toolbar_actions_bar_observer_; | 80 toolbar_actions_bar_observer_; |
| 86 | 81 |
| 87 base::WeakPtrFactory<ExtensionToolbarMenuView> weak_factory_; | 82 base::WeakPtrFactory<ExtensionToolbarMenuView> weak_factory_; |
| 88 | 83 |
| 89 DISALLOW_COPY_AND_ASSIGN(ExtensionToolbarMenuView); | 84 DISALLOW_COPY_AND_ASSIGN(ExtensionToolbarMenuView); |
| 90 }; | 85 }; |
| 91 | 86 |
| 92 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_EXTENSION_TOOLBAR_MENU_VIEW_H_ | 87 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_EXTENSION_TOOLBAR_MENU_VIEW_H_ |
| OLD | NEW |