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/common/shelf/shelf_item_types.h" | 9 #include "ash/common/shelf/shelf_item_types.h" |
10 #include "ash/common/wm_lookup.h" | 10 #include "ash/common/wm_lookup.h" |
11 #include "ash/common/wm_root_window_controller.h" | |
12 #include "ash/common/wm_shell.h" | 11 #include "ash/common/wm_shell.h" |
13 #include "ash/common/wm_window.h" | 12 #include "ash/common/wm_window.h" |
| 13 #include "ash/root_window_controller.h" |
14 #include "ash/shell.h" | 14 #include "ash/shell.h" |
15 #include "ash/test/ash_test_base.h" | 15 #include "ash/test/ash_test_base.h" |
16 #include "base/macros.h" | 16 #include "base/macros.h" |
17 #include "base/memory/ptr_util.h" | 17 #include "base/memory/ptr_util.h" |
18 #include "chrome/app/chrome_command_ids.h" | 18 #include "chrome/app/chrome_command_ids.h" |
19 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 19 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
20 #include "chrome/browser/profiles/profile.h" | 20 #include "chrome/browser/profiles/profile.h" |
21 #include "chrome/browser/ui/app_list/arc/arc_app_test.h" | 21 #include "chrome/browser/ui/app_list/arc/arc_app_test.h" |
22 #include "chrome/browser/ui/ash/launcher/arc_app_shelf_id.h" | 22 #include "chrome/browser/ui/ash/launcher/arc_app_shelf_id.h" |
23 #include "chrome/browser/ui/ash/launcher/arc_launcher_context_menu.h" | 23 #include "chrome/browser/ui/ash/launcher/arc_launcher_context_menu.h" |
(...skipping 27 matching lines...) Expand all Loading... |
51 profile(), ash::WmShell::Get()->shelf_model())); | 51 profile(), ash::WmShell::Get()->shelf_model())); |
52 controller_->Init(); | 52 controller_->Init(); |
53 } | 53 } |
54 | 54 |
55 void TearDown() override { | 55 void TearDown() override { |
56 controller_.reset(nullptr); | 56 controller_.reset(nullptr); |
57 ash::test::AshTestBase::TearDown(); | 57 ash::test::AshTestBase::TearDown(); |
58 } | 58 } |
59 | 59 |
60 ash::WmShelf* GetWmShelf(int64_t display_id) { | 60 ash::WmShelf* GetWmShelf(int64_t display_id) { |
61 ash::WmRootWindowController* root_window_controller = | 61 ash::RootWindowController* root_window_controller = |
62 ash::WmLookup::Get()->GetRootWindowControllerWithDisplayId(display_id); | 62 ash::WmLookup::Get()->GetRootWindowControllerWithDisplayId(display_id); |
63 EXPECT_NE(nullptr, root_window_controller); | 63 EXPECT_NE(nullptr, root_window_controller); |
64 return root_window_controller->GetShelf(); | 64 return root_window_controller->GetShelf(); |
65 } | 65 } |
66 | 66 |
67 LauncherContextMenu* CreateLauncherContextMenu( | 67 LauncherContextMenu* CreateLauncherContextMenu( |
68 ash::ShelfItemType shelf_item_type, | 68 ash::ShelfItemType shelf_item_type, |
69 ash::WmShelf* wm_shelf) { | 69 ash::WmShelf* wm_shelf) { |
70 ash::ShelfItem item; | 70 ash::ShelfItem item; |
71 item.id = 123; // dummy id | 71 item.id = 123; // dummy id |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 widget->SetFullscreen(true); | 305 widget->SetFullscreen(true); |
306 std::unique_ptr<LauncherContextMenu> primary_menu(CreateLauncherContextMenu( | 306 std::unique_ptr<LauncherContextMenu> primary_menu(CreateLauncherContextMenu( |
307 ash::TYPE_BROWSER_SHORTCUT, GetWmShelf(primary_id))); | 307 ash::TYPE_BROWSER_SHORTCUT, GetWmShelf(primary_id))); |
308 std::unique_ptr<LauncherContextMenu> secondary_menu(CreateLauncherContextMenu( | 308 std::unique_ptr<LauncherContextMenu> secondary_menu(CreateLauncherContextMenu( |
309 ash::TYPE_BROWSER_SHORTCUT, GetWmShelf(secondary_id))); | 309 ash::TYPE_BROWSER_SHORTCUT, GetWmShelf(secondary_id))); |
310 EXPECT_FALSE(IsItemPresentInMenu(primary_menu.get(), | 310 EXPECT_FALSE(IsItemPresentInMenu(primary_menu.get(), |
311 LauncherContextMenu::MENU_AUTO_HIDE)); | 311 LauncherContextMenu::MENU_AUTO_HIDE)); |
312 EXPECT_TRUE(IsItemPresentInMenu(secondary_menu.get(), | 312 EXPECT_TRUE(IsItemPresentInMenu(secondary_menu.get(), |
313 LauncherContextMenu::MENU_AUTO_HIDE)); | 313 LauncherContextMenu::MENU_AUTO_HIDE)); |
314 } | 314 } |
OLD | NEW |