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