| 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_ASH_LAUNCHER_LAUNCHER_CONTEXT_MENU_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_CONTEXT_MENU_H_ |
| 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_CONTEXT_MENU_H_ | 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_CONTEXT_MENU_H_ |
| 7 | 7 |
| 8 #include "ash/launcher/launcher_types.h" | 8 #include "ash/launcher/launcher_types.h" |
| 9 #include "ash/shelf/shelf_alignment_menu.h" | 9 #include "ash/shelf/shelf_alignment_menu.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "ui/base/models/simple_menu_model.h" | 13 #include "ui/base/models/simple_menu_model.h" |
| 14 | 14 |
| 15 class ChromeLauncherController; | 15 class ChromeLauncherController; |
| 16 | 16 |
| 17 namespace aura { | 17 namespace aura { |
| 18 class RootWindow; | 18 class Window; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace extensions { | 21 namespace extensions { |
| 22 class ContextMenuMatcher; | 22 class ContextMenuMatcher; |
| 23 } | 23 } |
| 24 | 24 |
| 25 // Context menu shown for a launcher item. | 25 // Context menu shown for a launcher item. |
| 26 class LauncherContextMenu : public ui::SimpleMenuModel, | 26 class LauncherContextMenu : public ui::SimpleMenuModel, |
| 27 public ui::SimpleMenuModel::Delegate { | 27 public ui::SimpleMenuModel::Delegate { |
| 28 public: | 28 public: |
| 29 // |item| is NULL if the context menu is for the launcher (the user right | 29 // |item| is NULL if the context menu is for the launcher (the user right |
| 30 // |clicked on an area with no icons). | 30 // |clicked on an area with no icons). |
| 31 LauncherContextMenu(ChromeLauncherController* controller, | 31 LauncherContextMenu(ChromeLauncherController* controller, |
| 32 const ash::LauncherItem* item, | 32 const ash::LauncherItem* item, |
| 33 aura::RootWindow* root_window); | 33 aura::Window* root_window); |
| 34 // Creates a menu used as a desktop context menu on |root_window|. | 34 // Creates a menu used as a desktop context menu on |root_window|. |
| 35 LauncherContextMenu(ChromeLauncherController* controller, | 35 LauncherContextMenu(ChromeLauncherController* controller, |
| 36 aura::RootWindow* root_window); | 36 aura::Window* root_window); |
| 37 virtual ~LauncherContextMenu(); | 37 virtual ~LauncherContextMenu(); |
| 38 | 38 |
| 39 void Init(); | 39 void Init(); |
| 40 | 40 |
| 41 // ID of the item we're showing the context menu for. | 41 // ID of the item we're showing the context menu for. |
| 42 ash::LauncherID id() const { return item_.id; } | 42 ash::LauncherID id() const { return item_.id; } |
| 43 | 43 |
| 44 // ui::SimpleMenuModel::Delegate overrides: | 44 // ui::SimpleMenuModel::Delegate overrides: |
| 45 virtual bool IsItemForCommandIdDynamic(int command_id) const OVERRIDE; | 45 virtual bool IsItemForCommandIdDynamic(int command_id) const OVERRIDE; |
| 46 virtual string16 GetLabelForCommandId(int command_id) const OVERRIDE; | 46 virtual string16 GetLabelForCommandId(int command_id) const OVERRIDE; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 bool is_valid_item() const { return item_.id != 0; } | 81 bool is_valid_item() const { return item_.id != 0; } |
| 82 | 82 |
| 83 ChromeLauncherController* controller_; | 83 ChromeLauncherController* controller_; |
| 84 | 84 |
| 85 ash::LauncherItem item_; | 85 ash::LauncherItem item_; |
| 86 | 86 |
| 87 ash::ShelfAlignmentMenu shelf_alignment_menu_; | 87 ash::ShelfAlignmentMenu shelf_alignment_menu_; |
| 88 | 88 |
| 89 scoped_ptr<extensions::ContextMenuMatcher> extension_items_; | 89 scoped_ptr<extensions::ContextMenuMatcher> extension_items_; |
| 90 | 90 |
| 91 aura::RootWindow* root_window_; | 91 aura::Window* root_window_; |
| 92 | 92 |
| 93 DISALLOW_COPY_AND_ASSIGN(LauncherContextMenu); | 93 DISALLOW_COPY_AND_ASSIGN(LauncherContextMenu); |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_CONTEXT_MENU_H_ | 96 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_CONTEXT_MENU_H_ |
| OLD | NEW |