| 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 <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "ash/public/cpp/shelf_item.h" | 9 #include "ash/public/cpp/shelf_item.h" |
| 10 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 ash::RootWindowController* root_window_controller = | 83 ash::RootWindowController* root_window_controller = |
| 84 ash::Shell::GetRootWindowControllerWithDisplayId(display_id); | 84 ash::Shell::GetRootWindowControllerWithDisplayId(display_id); |
| 85 EXPECT_NE(nullptr, root_window_controller); | 85 EXPECT_NE(nullptr, root_window_controller); |
| 86 return root_window_controller->GetShelf(); | 86 return root_window_controller->GetShelf(); |
| 87 } | 87 } |
| 88 | 88 |
| 89 LauncherContextMenu* CreateLauncherContextMenu( | 89 LauncherContextMenu* CreateLauncherContextMenu( |
| 90 ash::ShelfItemType shelf_item_type, | 90 ash::ShelfItemType shelf_item_type, |
| 91 ash::WmShelf* wm_shelf) { | 91 ash::WmShelf* wm_shelf) { |
| 92 ash::ShelfItem item; | 92 ash::ShelfItem item; |
| 93 item.id = 123; // dummy id | 93 item.id = ash::ShelfID("dummy id"); |
| 94 item.type = shelf_item_type; | 94 item.type = shelf_item_type; |
| 95 return LauncherContextMenu::Create(controller(), &item, wm_shelf); | 95 return LauncherContextMenu::Create(controller(), &item, wm_shelf); |
| 96 } | 96 } |
| 97 | 97 |
| 98 LauncherContextMenu* CreateLauncherContextMenuForDesktopShell( | 98 LauncherContextMenu* CreateLauncherContextMenuForDesktopShell( |
| 99 ash::WmShelf* wm_shelf) { | 99 ash::WmShelf* wm_shelf) { |
| 100 return LauncherContextMenu::Create(controller(), nullptr, wm_shelf); | 100 return LauncherContextMenu::Create(controller(), nullptr, wm_shelf); |
| 101 } | 101 } |
| 102 | 102 |
| 103 // Creates app window and set optional ARC application id. | 103 // Creates app window and set optional ARC application id. |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 ash::TYPE_BROWSER_SHORTCUT, GetWmShelf(primary_id))); | 327 ash::TYPE_BROWSER_SHORTCUT, GetWmShelf(primary_id))); |
| 328 std::unique_ptr<LauncherContextMenu> secondary_menu(CreateLauncherContextMenu( | 328 std::unique_ptr<LauncherContextMenu> secondary_menu(CreateLauncherContextMenu( |
| 329 ash::TYPE_BROWSER_SHORTCUT, GetWmShelf(secondary_id))); | 329 ash::TYPE_BROWSER_SHORTCUT, GetWmShelf(secondary_id))); |
| 330 EXPECT_FALSE(IsItemPresentInMenu(primary_menu.get(), | 330 EXPECT_FALSE(IsItemPresentInMenu(primary_menu.get(), |
| 331 LauncherContextMenu::MENU_AUTO_HIDE)); | 331 LauncherContextMenu::MENU_AUTO_HIDE)); |
| 332 EXPECT_TRUE(IsItemPresentInMenu(secondary_menu.get(), | 332 EXPECT_TRUE(IsItemPresentInMenu(secondary_menu.get(), |
| 333 LauncherContextMenu::MENU_AUTO_HIDE)); | 333 LauncherContextMenu::MENU_AUTO_HIDE)); |
| 334 } | 334 } |
| 335 | 335 |
| 336 } // namespace | 336 } // namespace |
| OLD | NEW |