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" | 17 #include "chrome/browser/extensions/extension_context_menu_model.h" |
18 #include "chrome/browser/extensions/extension_toolbar_model.h" | 18 #include "chrome/browser/extensions/extension_toolbar_model.h" |
19 #include "chrome/browser/extensions/image_loading_tracker.h" | 19 #include "chrome/browser/extensions/image_loading_tracker.h" |
20 #include "chrome/browser/ui/views/extensions/browser_action_overflow_menu_contro
ller.h" | 20 #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" | 21 #include "chrome/browser/ui/views/extensions/extension_keybinding_registry_views
.h" |
22 #include "chrome/browser/ui/views/extensions/extension_popup.h" | 22 #include "chrome/browser/ui/views/extensions/extension_popup.h" |
23 #include "content/public/browser/notification_observer.h" | 23 #include "content/public/browser/notification_observer.h" |
24 #include "content/public/browser/notification_registrar.h" | 24 #include "content/public/browser/notification_registrar.h" |
25 #include "ui/base/accelerators/accelerator.h" | 25 #include "ui/base/accelerators/accelerator.h" |
26 #include "ui/base/animation/animation_delegate.h" | 26 #include "ui/base/animation/animation_delegate.h" |
27 #include "ui/base/animation/tween.h" | 27 #include "ui/base/animation/tween.h" |
28 #include "ui/views/controls/button/menu_button.h" | 28 #include "ui/views/controls/button/menu_button.h" |
29 #include "ui/views/controls/button/menu_button_delegate.h" | 29 #include "ui/views/controls/button/menu_button_listener.h" |
30 #include "ui/views/controls/resize_area_delegate.h" | 30 #include "ui/views/controls/resize_area_delegate.h" |
31 #include "ui/views/drag_controller.h" | 31 #include "ui/views/drag_controller.h" |
32 #include "ui/views/view.h" | 32 #include "ui/views/view.h" |
33 | 33 |
34 class Browser; | 34 class Browser; |
35 class BrowserActionOverflowMenuController; | 35 class BrowserActionOverflowMenuController; |
36 class BrowserActionsContainer; | 36 class BrowserActionsContainer; |
37 class Extension; | 37 class Extension; |
38 class ExtensionAction; | 38 class ExtensionAction; |
39 class ExtensionPopup; | 39 class ExtensionPopup; |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 // | 258 // |
259 // NOTE: When adding Browser Actions to a maximum width container (no overflow) | 259 // NOTE: When adding Browser Actions to a maximum width container (no overflow) |
260 // we make sure to suppress the chevron menu if it wasn't visible. This is | 260 // we make sure to suppress the chevron menu if it wasn't visible. This is |
261 // because we won't have enough space to show the new Browser Action until the | 261 // because we won't have enough space to show the new Browser Action until the |
262 // animation ends and we don't want the chevron to flash into view while we are | 262 // animation ends and we don't want the chevron to flash into view while we are |
263 // growing the container. | 263 // growing the container. |
264 // | 264 // |
265 //////////////////////////////////////////////////////////////////////////////// | 265 //////////////////////////////////////////////////////////////////////////////// |
266 class BrowserActionsContainer | 266 class BrowserActionsContainer |
267 : public views::View, | 267 : public views::View, |
268 public views::MenuButtonDelegate, | 268 public views::MenuButtonListener, |
269 public views::DragController, | 269 public views::DragController, |
270 public views::ResizeAreaDelegate, | 270 public views::ResizeAreaDelegate, |
271 public ui::AnimationDelegate, | 271 public ui::AnimationDelegate, |
272 public ExtensionToolbarModel::Observer, | 272 public ExtensionToolbarModel::Observer, |
273 public BrowserActionOverflowMenuController::Observer, | 273 public BrowserActionOverflowMenuController::Observer, |
274 public ExtensionContextMenuModel::PopupDelegate, | 274 public ExtensionContextMenuModel::PopupDelegate, |
275 public views::Widget::Observer { | 275 public views::Widget::Observer { |
276 public: | 276 public: |
277 BrowserActionsContainer(Browser* browser, views::View* owner_view); | 277 BrowserActionsContainer(Browser* browser, views::View* owner_view); |
278 virtual ~BrowserActionsContainer(); | 278 virtual ~BrowserActionsContainer(); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 virtual bool GetDropFormats(int* formats, | 333 virtual bool GetDropFormats(int* formats, |
334 std::set<ui::OSExchangeData::CustomFormat>* custom_formats) OVERRIDE; | 334 std::set<ui::OSExchangeData::CustomFormat>* custom_formats) OVERRIDE; |
335 virtual bool AreDropTypesRequired() OVERRIDE; | 335 virtual bool AreDropTypesRequired() OVERRIDE; |
336 virtual bool CanDrop(const ui::OSExchangeData& data) OVERRIDE; | 336 virtual bool CanDrop(const ui::OSExchangeData& data) OVERRIDE; |
337 virtual void OnDragEntered(const views::DropTargetEvent& event) OVERRIDE; | 337 virtual void OnDragEntered(const views::DropTargetEvent& event) OVERRIDE; |
338 virtual int OnDragUpdated(const views::DropTargetEvent& event) OVERRIDE; | 338 virtual int OnDragUpdated(const views::DropTargetEvent& event) OVERRIDE; |
339 virtual void OnDragExited() OVERRIDE; | 339 virtual void OnDragExited() OVERRIDE; |
340 virtual int OnPerformDrop(const views::DropTargetEvent& event) OVERRIDE; | 340 virtual int OnPerformDrop(const views::DropTargetEvent& event) OVERRIDE; |
341 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; | 341 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; |
342 | 342 |
343 // Overridden from views::MenuButtonDelegate: | 343 // Overridden from views::MenuButtonListener: |
344 virtual void RunMenu(View* source, const gfx::Point& pt) OVERRIDE; | 344 virtual void OnMenuButtonClicked(views::View* source, |
| 345 const gfx::Point& point) OVERRIDE; |
345 | 346 |
346 // Overridden from views::DragController: | 347 // Overridden from views::DragController: |
347 virtual void WriteDragDataForView(View* sender, | 348 virtual void WriteDragDataForView(View* sender, |
348 const gfx::Point& press_pt, | 349 const gfx::Point& press_pt, |
349 ui::OSExchangeData* data) OVERRIDE; | 350 ui::OSExchangeData* data) OVERRIDE; |
350 virtual int GetDragOperationsForView(View* sender, | 351 virtual int GetDragOperationsForView(View* sender, |
351 const gfx::Point& p) OVERRIDE; | 352 const gfx::Point& p) OVERRIDE; |
352 virtual bool CanStartDragForView(View* sender, | 353 virtual bool CanStartDragForView(View* sender, |
353 const gfx::Point& press_pt, | 354 const gfx::Point& press_pt, |
354 const gfx::Point& p) OVERRIDE; | 355 const gfx::Point& p) OVERRIDE; |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 | 528 |
528 base::WeakPtrFactory<BrowserActionsContainer> task_factory_; | 529 base::WeakPtrFactory<BrowserActionsContainer> task_factory_; |
529 | 530 |
530 // Handles delayed showing of the overflow menu when hovering. | 531 // Handles delayed showing of the overflow menu when hovering. |
531 base::WeakPtrFactory<BrowserActionsContainer> show_menu_task_factory_; | 532 base::WeakPtrFactory<BrowserActionsContainer> show_menu_task_factory_; |
532 | 533 |
533 DISALLOW_COPY_AND_ASSIGN(BrowserActionsContainer); | 534 DISALLOW_COPY_AND_ASSIGN(BrowserActionsContainer); |
534 }; | 535 }; |
535 | 536 |
536 #endif // CHROME_BROWSER_UI_VIEWS_BROWSER_ACTIONS_CONTAINER_H_ | 537 #endif // CHROME_BROWSER_UI_VIEWS_BROWSER_ACTIONS_CONTAINER_H_ |
OLD | NEW |