| 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; |
| 21 class MenuItemView; | 22 class MenuItemView; |
| 22 class MenuRunner; | 23 class MenuRunner; |
| 23 class View; | 24 class View; |
| 24 } | 25 } |
| 25 | 26 |
| 26 // ActionBoxMenu adapts the ActionBoxMenuModel to view's menu related classes. | 27 // ActionBoxMenu adapts the ActionBoxMenuModel to view's menu related classes. |
| 27 class ActionBoxMenu : public views::MenuDelegate, | 28 class ActionBoxMenu : public views::MenuDelegate, |
| 28 public BrowserActionView::Delegate { | 29 public BrowserActionView::Delegate { |
| 29 public: | 30 public: |
| 30 // Constructs and initializes an ActionBoxMenu. | 31 // Constructs and initializes an ActionBoxMenu. |
| (...skipping 27 matching lines...) Expand all Loading... |
| 58 ui::OSExchangeData* data) OVERRIDE; | 59 ui::OSExchangeData* data) OVERRIDE; |
| 59 virtual int GetDragOperationsForView(views::View* sender, | 60 virtual int GetDragOperationsForView(views::View* sender, |
| 60 const gfx::Point& p) OVERRIDE; | 61 const gfx::Point& p) OVERRIDE; |
| 61 virtual bool CanStartDragForView(views::View* sender, | 62 virtual bool CanStartDragForView(views::View* sender, |
| 62 const gfx::Point& press_pt, | 63 const gfx::Point& press_pt, |
| 63 const gfx::Point& p) OVERRIDE; | 64 const gfx::Point& p) OVERRIDE; |
| 64 | 65 |
| 65 // Populates |root_| with all the child menu items from the |model_|. | 66 // Populates |root_| with all the child menu items from the |model_|. |
| 66 void PopulateMenu(); | 67 void PopulateMenu(); |
| 67 | 68 |
| 69 void CustomizeMenu(views::MenuConfig* menu_config); |
| 70 |
| 68 Browser* browser_; | 71 Browser* browser_; |
| 69 | 72 |
| 70 scoped_ptr<views::MenuRunner> menu_runner_; | 73 scoped_ptr<views::MenuRunner> menu_runner_; |
| 71 | 74 |
| 72 // The model that tracks the order of the toolbar icons. | 75 // The model that tracks the order of the toolbar icons. |
| 73 scoped_ptr<ActionBoxMenuModel> model_; | 76 scoped_ptr<ActionBoxMenuModel> model_; |
| 74 | 77 |
| 75 DISALLOW_COPY_AND_ASSIGN(ActionBoxMenu); | 78 DISALLOW_COPY_AND_ASSIGN(ActionBoxMenu); |
| 76 }; | 79 }; |
| 77 | 80 |
| 78 #endif // CHROME_BROWSER_UI_VIEWS_ACTION_BOX_MENU_H_ | 81 #endif // CHROME_BROWSER_UI_VIEWS_ACTION_BOX_MENU_H_ |
| OLD | NEW |