| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "base/message_loop_helpers.h" | 16 #include "base/message_loop_helpers.h" |
| 17 #include "chrome/browser/extensions/extension_context_menu_model.h" | |
| 18 #include "chrome/browser/extensions/extension_toolbar_model.h" | 17 #include "chrome/browser/extensions/extension_toolbar_model.h" |
| 19 #include "chrome/browser/extensions/image_loading_tracker.h" | 18 #include "chrome/browser/extensions/image_loading_tracker.h" |
| 20 #include "chrome/browser/ui/views/extensions/browser_action_overflow_menu_contro
ller.h" | 19 #include "chrome/browser/ui/views/extensions/browser_action_overflow_menu_contro
ller.h" |
| 21 #include "chrome/browser/ui/views/extensions/extension_keybinding_registry_views
.h" | 20 #include "chrome/browser/ui/views/extensions/extension_keybinding_registry_views
.h" |
| 22 #include "chrome/browser/ui/views/extensions/extension_popup.h" | 21 #include "chrome/browser/ui/views/extensions/extension_popup.h" |
| 23 #include "content/public/browser/notification_observer.h" | 22 #include "content/public/browser/notification_observer.h" |
| 24 #include "content/public/browser/notification_registrar.h" | 23 #include "content/public/browser/notification_registrar.h" |
| 25 #include "ui/base/accelerators/accelerator.h" | 24 #include "ui/base/accelerators/accelerator.h" |
| 26 #include "ui/base/animation/animation_delegate.h" | 25 #include "ui/base/animation/animation_delegate.h" |
| 27 #include "ui/base/animation/tween.h" | 26 #include "ui/base/animation/tween.h" |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 // | 263 // |
| 265 //////////////////////////////////////////////////////////////////////////////// | 264 //////////////////////////////////////////////////////////////////////////////// |
| 266 class BrowserActionsContainer | 265 class BrowserActionsContainer |
| 267 : public views::View, | 266 : public views::View, |
| 268 public views::MenuButtonListener, | 267 public views::MenuButtonListener, |
| 269 public views::DragController, | 268 public views::DragController, |
| 270 public views::ResizeAreaDelegate, | 269 public views::ResizeAreaDelegate, |
| 271 public ui::AnimationDelegate, | 270 public ui::AnimationDelegate, |
| 272 public ExtensionToolbarModel::Observer, | 271 public ExtensionToolbarModel::Observer, |
| 273 public BrowserActionOverflowMenuController::Observer, | 272 public BrowserActionOverflowMenuController::Observer, |
| 274 public ExtensionContextMenuModel::PopupDelegate, | |
| 275 public views::Widget::Observer { | 273 public views::Widget::Observer { |
| 276 public: | 274 public: |
| 277 BrowserActionsContainer(Browser* browser, views::View* owner_view); | 275 BrowserActionsContainer(Browser* browser, views::View* owner_view); |
| 278 virtual ~BrowserActionsContainer(); | 276 virtual ~BrowserActionsContainer(); |
| 279 | 277 |
| 280 static void RegisterUserPrefs(PrefService* prefs); | 278 static void RegisterUserPrefs(PrefService* prefs); |
| 281 | 279 |
| 282 void Init(); | 280 void Init(); |
| 283 | 281 |
| 284 // Get the number of browser actions being displayed. | 282 // Get the number of browser actions being displayed. |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 virtual void OnResize(int resize_amount, bool done_resizing) OVERRIDE; | 356 virtual void OnResize(int resize_amount, bool done_resizing) OVERRIDE; |
| 359 | 357 |
| 360 // Overridden from ui::AnimationDelegate: | 358 // Overridden from ui::AnimationDelegate: |
| 361 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; | 359 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; |
| 362 virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE; | 360 virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE; |
| 363 | 361 |
| 364 // Overridden from BrowserActionOverflowMenuController::Observer: | 362 // Overridden from BrowserActionOverflowMenuController::Observer: |
| 365 virtual void NotifyMenuDeleted( | 363 virtual void NotifyMenuDeleted( |
| 366 BrowserActionOverflowMenuController* controller) OVERRIDE; | 364 BrowserActionOverflowMenuController* controller) OVERRIDE; |
| 367 | 365 |
| 368 // Overridden from ExtensionContextMenuModel::PopupDelegate | |
| 369 virtual void InspectPopup(ExtensionAction* action) OVERRIDE; | |
| 370 | |
| 371 // Overridden from views::Widget::Observer | 366 // Overridden from views::Widget::Observer |
| 372 virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE; | 367 virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE; |
| 373 | 368 |
| 374 // Moves a browser action with |id| to |new_index|. | 369 // Moves a browser action with |id| to |new_index|. |
| 375 void MoveBrowserAction(const std::string& extension_id, size_t new_index); | 370 void MoveBrowserAction(const std::string& extension_id, size_t new_index); |
| 376 | 371 |
| 377 // Hide the current popup. | 372 // Hide the current popup. |
| 378 void HidePopup(); | 373 void HidePopup(); |
| 379 | 374 |
| 380 // Simulate a click on a browser action button. This should only be | 375 // Simulate a click on a browser action button. This should only be |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 | 523 |
| 529 base::WeakPtrFactory<BrowserActionsContainer> task_factory_; | 524 base::WeakPtrFactory<BrowserActionsContainer> task_factory_; |
| 530 | 525 |
| 531 // Handles delayed showing of the overflow menu when hovering. | 526 // Handles delayed showing of the overflow menu when hovering. |
| 532 base::WeakPtrFactory<BrowserActionsContainer> show_menu_task_factory_; | 527 base::WeakPtrFactory<BrowserActionsContainer> show_menu_task_factory_; |
| 533 | 528 |
| 534 DISALLOW_COPY_AND_ASSIGN(BrowserActionsContainer); | 529 DISALLOW_COPY_AND_ASSIGN(BrowserActionsContainer); |
| 535 }; | 530 }; |
| 536 | 531 |
| 537 #endif // CHROME_BROWSER_UI_VIEWS_BROWSER_ACTIONS_CONTAINER_H_ | 532 #endif // CHROME_BROWSER_UI_VIEWS_BROWSER_ACTIONS_CONTAINER_H_ |
| OLD | NEW |