| 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_ACTION_BOX_MENU_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_ACTION_BOX_MENU_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_ACTION_BOX_MENU_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_ACTION_BOX_MENU_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/memory/scoped_vector.h" | 11 #include "base/memory/scoped_vector.h" |
| 12 #include "chrome/browser/ui/views/browser_action_view.h" | 12 #include "chrome/browser/ui/views/browser_action_view.h" |
| 13 #include "ui/views/controls/menu/menu_delegate.h" | 13 #include "ui/views/controls/menu/menu_delegate.h" |
| 14 | 14 |
| 15 class ActionBoxButtonController; | 15 class ActionBoxButtonController; |
| 16 class ActionBoxMenuModel; | 16 class ActionBoxMenuModel; |
| 17 | 17 |
| 18 namespace views { | 18 namespace views { |
| 19 class Background; | 19 class Background; |
| 20 class Border; | 20 class Border; |
| 21 struct MenuConfig; | |
| 22 class MenuItemView; | 21 class MenuItemView; |
| 23 class MenuRunner; | 22 class MenuRunner; |
| 24 class View; | 23 class View; |
| 25 } | 24 } |
| 26 | 25 |
| 27 // ActionBoxMenu adapts the ActionBoxMenuModel to view's menu related classes. | 26 // ActionBoxMenu adapts the ActionBoxMenuModel to view's menu related classes. |
| 28 class ActionBoxMenu : public views::MenuDelegate, | 27 class ActionBoxMenu : public views::MenuDelegate, |
| 29 public BrowserActionView::Delegate { | 28 public BrowserActionView::Delegate { |
| 30 public: | 29 public: |
| 31 // Constructs and initializes an ActionBoxMenu. | 30 // Constructs and initializes an ActionBoxMenu. |
| (...skipping 27 matching lines...) Expand all Loading... |
| 59 ui::OSExchangeData* data) OVERRIDE; | 58 ui::OSExchangeData* data) OVERRIDE; |
| 60 virtual int GetDragOperationsForView(views::View* sender, | 59 virtual int GetDragOperationsForView(views::View* sender, |
| 61 const gfx::Point& p) OVERRIDE; | 60 const gfx::Point& p) OVERRIDE; |
| 62 virtual bool CanStartDragForView(views::View* sender, | 61 virtual bool CanStartDragForView(views::View* sender, |
| 63 const gfx::Point& press_pt, | 62 const gfx::Point& press_pt, |
| 64 const gfx::Point& p) OVERRIDE; | 63 const gfx::Point& p) OVERRIDE; |
| 65 | 64 |
| 66 // Populates |root_| with all the child menu items from the |model_|. | 65 // Populates |root_| with all the child menu items from the |model_|. |
| 67 void PopulateMenu(); | 66 void PopulateMenu(); |
| 68 | 67 |
| 69 void CustomizeMenu(views::MenuConfig* menu_config); | |
| 70 | |
| 71 Browser* browser_; | 68 Browser* browser_; |
| 72 | 69 |
| 73 scoped_ptr<views::MenuRunner> menu_runner_; | 70 scoped_ptr<views::MenuRunner> menu_runner_; |
| 74 | 71 |
| 75 // The model that tracks the order of the toolbar icons. | 72 // The model that tracks the order of the toolbar icons. |
| 76 scoped_ptr<ActionBoxMenuModel> model_; | 73 scoped_ptr<ActionBoxMenuModel> model_; |
| 77 | 74 |
| 78 DISALLOW_COPY_AND_ASSIGN(ActionBoxMenu); | 75 DISALLOW_COPY_AND_ASSIGN(ActionBoxMenu); |
| 79 }; | 76 }; |
| 80 | 77 |
| 81 #endif // CHROME_BROWSER_UI_VIEWS_ACTION_BOX_MENU_H_ | 78 #endif // CHROME_BROWSER_UI_VIEWS_ACTION_BOX_MENU_H_ |
| OLD | NEW |