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 #include "chrome/browser/ui/ash/launcher/launcher_context_menu.h" | 5 #include "chrome/browser/ui/ash/launcher/launcher_context_menu.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "ash/desktop_background/user_wallpaper_delegate.h" | 9 #include "ash/desktop_background/user_wallpaper_delegate.h" |
10 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 namespace { | 30 namespace { |
31 | 31 |
32 bool MenuItemHasLauncherContext(const extensions::MenuItem* item) { | 32 bool MenuItemHasLauncherContext(const extensions::MenuItem* item) { |
33 return item->contexts().Contains(extensions::MenuItem::LAUNCHER); | 33 return item->contexts().Contains(extensions::MenuItem::LAUNCHER); |
34 } | 34 } |
35 | 35 |
36 } // namespace | 36 } // namespace |
37 | 37 |
38 LauncherContextMenu::LauncherContextMenu(ChromeLauncherController* controller, | 38 LauncherContextMenu::LauncherContextMenu(ChromeLauncherController* controller, |
39 const ash::LauncherItem* item, | 39 const ash::LauncherItem* item, |
40 aura::RootWindow* root) | 40 aura::Window* root) |
41 : ui::SimpleMenuModel(NULL), | 41 : ui::SimpleMenuModel(NULL), |
42 controller_(controller), | 42 controller_(controller), |
43 item_(*item), | 43 item_(*item), |
44 shelf_alignment_menu_(root), | 44 shelf_alignment_menu_(root), |
45 root_window_(root) { | 45 root_window_(root) { |
46 DCHECK(item); | 46 DCHECK(item); |
47 DCHECK(root_window_); | 47 DCHECK(root_window_); |
48 Init(); | 48 Init(); |
49 } | 49 } |
50 | 50 |
51 LauncherContextMenu::LauncherContextMenu(ChromeLauncherController* controller, | 51 LauncherContextMenu::LauncherContextMenu(ChromeLauncherController* controller, |
52 aura::RootWindow* root) | 52 aura::Window* root) |
53 : ui::SimpleMenuModel(NULL), | 53 : ui::SimpleMenuModel(NULL), |
54 controller_(controller), | 54 controller_(controller), |
55 item_(ash::LauncherItem()), | 55 item_(ash::LauncherItem()), |
56 shelf_alignment_menu_(root), | 56 shelf_alignment_menu_(root), |
57 extension_items_(new extensions::ContextMenuMatcher( | 57 extension_items_(new extensions::ContextMenuMatcher( |
58 controller->profile(), this, this, | 58 controller->profile(), this, this, |
59 base::Bind(MenuItemHasLauncherContext))), | 59 base::Bind(MenuItemHasLauncherContext))), |
60 root_window_(root) { | 60 root_window_(root) { |
61 DCHECK(root_window_); | 61 DCHECK(root_window_); |
62 Init(); | 62 Init(); |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 case MENU_CHANGE_WALLPAPER: | 274 case MENU_CHANGE_WALLPAPER: |
275 ash::Shell::GetInstance()->user_wallpaper_delegate()-> | 275 ash::Shell::GetInstance()->user_wallpaper_delegate()-> |
276 OpenSetWallpaperPage(); | 276 OpenSetWallpaperPage(); |
277 break; | 277 break; |
278 #endif | 278 #endif |
279 default: | 279 default: |
280 extension_items_->ExecuteCommand(command_id, NULL, | 280 extension_items_->ExecuteCommand(command_id, NULL, |
281 content::ContextMenuParams()); | 281 content::ContextMenuParams()); |
282 } | 282 } |
283 } | 283 } |
OLD | NEW |