OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "ash/common/shelf/shelf_item_types.h" | 7 #include "ash/common/shelf/shelf_item_types.h" |
8 #include "ash/common/wm_root_window_controller.h" | 8 #include "ash/common/wm_root_window_controller.h" |
9 #include "ash/common/wm_shell.h" | 9 #include "ash/common/wm_shell.h" |
10 #include "ash/common/wm_window.h" | 10 #include "ash/common/wm_window.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 ash::WmShelf* GetWmShelf() { | 48 ash::WmShelf* GetWmShelf() { |
49 return ash::WmShell::Get() | 49 return ash::WmShell::Get() |
50 ->GetPrimaryRootWindow() | 50 ->GetPrimaryRootWindow() |
51 ->GetRootWindowController() | 51 ->GetRootWindowController() |
52 ->GetShelf(); | 52 ->GetShelf(); |
53 } | 53 } |
54 | 54 |
55 LauncherContextMenu* CreateLauncherContextMenu( | 55 LauncherContextMenu* CreateLauncherContextMenu( |
56 ash::ShelfItemType shelf_item_type) { | 56 ash::ShelfItemType shelf_item_type) { |
57 ash::ShelfItem item; | 57 ash::ShelfItem item; |
58 item.id = 1; // dummy id | 58 item.id = 123; // dummy id |
59 item.type = shelf_item_type; | 59 item.type = shelf_item_type; |
60 return LauncherContextMenu::Create(controller_.get(), &item, GetWmShelf()); | 60 return LauncherContextMenu::Create(controller_.get(), &item, GetWmShelf()); |
61 } | 61 } |
62 | 62 |
63 LauncherContextMenu* CreateLauncherContextMenuForDesktopShell() { | 63 LauncherContextMenu* CreateLauncherContextMenuForDesktopShell() { |
64 ash::ShelfItem* item = nullptr; | 64 ash::ShelfItem* item = nullptr; |
65 return LauncherContextMenu::Create(controller_.get(), item, GetWmShelf()); | 65 return LauncherContextMenu::Create(controller_.get(), item, GetWmShelf()); |
66 } | 66 } |
67 | 67 |
68 ArcAppTest& arc_test() { return arc_test_; } | 68 ArcAppTest& arc_test() { return arc_test_; } |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 arc_test().app_instance()->SendTaskCreated(1, arc_test().fake_apps()[0]); | 196 arc_test().app_instance()->SendTaskCreated(1, arc_test().fake_apps()[0]); |
197 menu.reset(new ArcLauncherContextMenu(controller(), &item, wm_shelf)); | 197 menu.reset(new ArcLauncherContextMenu(controller(), &item, wm_shelf)); |
198 | 198 |
199 EXPECT_FALSE( | 199 EXPECT_FALSE( |
200 IsItemPresentInMenu(menu.get(), LauncherContextMenu::MENU_OPEN_NEW)); | 200 IsItemPresentInMenu(menu.get(), LauncherContextMenu::MENU_OPEN_NEW)); |
201 EXPECT_TRUE(IsItemPresentInMenu(menu.get(), LauncherContextMenu::MENU_PIN)); | 201 EXPECT_TRUE(IsItemPresentInMenu(menu.get(), LauncherContextMenu::MENU_PIN)); |
202 EXPECT_TRUE(menu->IsCommandIdEnabled(LauncherContextMenu::MENU_PIN)); | 202 EXPECT_TRUE(menu->IsCommandIdEnabled(LauncherContextMenu::MENU_PIN)); |
203 EXPECT_TRUE(IsItemPresentInMenu(menu.get(), LauncherContextMenu::MENU_CLOSE)); | 203 EXPECT_TRUE(IsItemPresentInMenu(menu.get(), LauncherContextMenu::MENU_CLOSE)); |
204 EXPECT_TRUE(menu->IsCommandIdEnabled(LauncherContextMenu::MENU_CLOSE)); | 204 EXPECT_TRUE(menu->IsCommandIdEnabled(LauncherContextMenu::MENU_CLOSE)); |
205 } | 205 } |
OLD | NEW |