| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_BROWSER_ACTIONS_CONTAINER_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_BROWSER_ACTIONS_CONTAINER_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_BROWSER_ACTIONS_CONTAINER_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_BROWSER_ACTIONS_CONTAINER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 namespace gfx { | 39 namespace gfx { |
| 40 class CanvasSkia; | 40 class CanvasSkia; |
| 41 } | 41 } |
| 42 | 42 |
| 43 namespace ui { | 43 namespace ui { |
| 44 class SlideAnimation; | 44 class SlideAnimation; |
| 45 } | 45 } |
| 46 | 46 |
| 47 namespace views { | 47 namespace views { |
| 48 class Menu2; | 48 class MenuItemView; |
| 49 } | 49 } |
| 50 | 50 |
| 51 //////////////////////////////////////////////////////////////////////////////// | 51 //////////////////////////////////////////////////////////////////////////////// |
| 52 // BrowserActionButton | 52 // BrowserActionButton |
| 53 | 53 |
| 54 // The BrowserActionButton is a specialization of the MenuButton class. | 54 // The BrowserActionButton is a specialization of the MenuButton class. |
| 55 // It acts on a ExtensionAction, in this case a BrowserAction and handles | 55 // It acts on a ExtensionAction, in this case a BrowserAction and handles |
| 56 // loading the image for the button asynchronously on the file thread. | 56 // loading the image for the button asynchronously on the file thread. |
| 57 class BrowserActionButton : public views::MenuButton, | 57 class BrowserActionButton : public views::MenuButton, |
| 58 public views::ButtonListener, | 58 public views::ButtonListener, |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 // by this class. | 123 // by this class. |
| 124 ExtensionAction* browser_action_; | 124 ExtensionAction* browser_action_; |
| 125 | 125 |
| 126 // The extension associated with the browser action we're displaying. | 126 // The extension associated with the browser action we're displaying. |
| 127 const Extension* extension_; | 127 const Extension* extension_; |
| 128 | 128 |
| 129 // The object that is waiting for the image loading to complete | 129 // The object that is waiting for the image loading to complete |
| 130 // asynchronously. | 130 // asynchronously. |
| 131 ImageLoadingTracker tracker_; | 131 ImageLoadingTracker tracker_; |
| 132 | 132 |
| 133 // Whether we are currently showing/just finished showing a context menu. | |
| 134 bool showing_context_menu_; | |
| 135 | |
| 136 // The default icon for our browser action. This might be non-empty if the | 133 // The default icon for our browser action. This might be non-empty if the |
| 137 // browser action had a value for default_icon in the manifest. | 134 // browser action had a value for default_icon in the manifest. |
| 138 SkBitmap default_icon_; | 135 SkBitmap default_icon_; |
| 139 | 136 |
| 140 // The browser action shelf. | 137 // The browser action shelf. |
| 141 BrowserActionsContainer* panel_; | 138 BrowserActionsContainer* panel_; |
| 142 | 139 |
| 143 scoped_refptr<ExtensionContextMenuModel> context_menu_contents_; | 140 // The context menu. This member is non-NULL only when the menu is shown. |
| 144 scoped_ptr<views::Menu2> context_menu_menu_; | 141 views::MenuItemView* context_menu_; |
| 145 | 142 |
| 146 NotificationRegistrar registrar_; | 143 NotificationRegistrar registrar_; |
| 147 | 144 |
| 148 friend class DeleteTask<BrowserActionButton>; | 145 friend class DeleteTask<BrowserActionButton>; |
| 149 | 146 |
| 150 DISALLOW_COPY_AND_ASSIGN(BrowserActionButton); | 147 DISALLOW_COPY_AND_ASSIGN(BrowserActionButton); |
| 151 }; | 148 }; |
| 152 | 149 |
| 153 | 150 |
| 154 //////////////////////////////////////////////////////////////////////////////// | 151 //////////////////////////////////////////////////////////////////////////////// |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 | 513 |
| 517 ScopedRunnableMethodFactory<BrowserActionsContainer> task_factory_; | 514 ScopedRunnableMethodFactory<BrowserActionsContainer> task_factory_; |
| 518 | 515 |
| 519 // Handles delayed showing of the overflow menu when hovering. | 516 // Handles delayed showing of the overflow menu when hovering. |
| 520 ScopedRunnableMethodFactory<BrowserActionsContainer> show_menu_task_factory_; | 517 ScopedRunnableMethodFactory<BrowserActionsContainer> show_menu_task_factory_; |
| 521 | 518 |
| 522 DISALLOW_COPY_AND_ASSIGN(BrowserActionsContainer); | 519 DISALLOW_COPY_AND_ASSIGN(BrowserActionsContainer); |
| 523 }; | 520 }; |
| 524 | 521 |
| 525 #endif // CHROME_BROWSER_UI_VIEWS_BROWSER_ACTIONS_CONTAINER_H_ | 522 #endif // CHROME_BROWSER_UI_VIEWS_BROWSER_ACTIONS_CONTAINER_H_ |
| OLD | NEW |