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/shelf/shelf.h" | 7 #include "ash/shelf/shelf.h" |
8 #include "ash/shelf/shelf_item_types.h" | 8 #include "ash/shelf/shelf_item_types.h" |
9 #include "ash/shelf/shelf_model.h" | 9 #include "ash/shelf/shelf_model.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
11 #include "ash/test/ash_test_base.h" | 11 #include "ash/test/ash_test_base.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/prefs/pref_service.h" | |
14 #include "chrome/app/chrome_command_ids.h" | 13 #include "chrome/app/chrome_command_ids.h" |
15 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 14 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
16 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
17 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" | 16 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
18 #include "chrome/test/base/testing_profile.h" | 17 #include "chrome/test/base/testing_profile.h" |
| 18 #include "components/prefs/pref_service.h" |
19 #include "ui/aura/window_event_dispatcher.h" | 19 #include "ui/aura/window_event_dispatcher.h" |
20 | 20 |
21 class TestChromeLauncherController : public ChromeLauncherController { | 21 class TestChromeLauncherController : public ChromeLauncherController { |
22 public: | 22 public: |
23 TestChromeLauncherController(Profile* profile, ash::ShelfModel* model) | 23 TestChromeLauncherController(Profile* profile, ash::ShelfModel* model) |
24 : ChromeLauncherController(profile, model) {} | 24 : ChromeLauncherController(profile, model) {} |
25 bool IsLoggedInAsGuest() override { return false; } | 25 bool IsLoggedInAsGuest() override { return false; } |
26 private: | 26 private: |
27 DISALLOW_COPY_AND_ASSIGN(TestChromeLauncherController); | 27 DISALLOW_COPY_AND_ASSIGN(TestChromeLauncherController); |
28 }; | 28 }; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 EXPECT_TRUE(menu->IsCommandIdEnabled(LauncherContextMenu::MENU_NEW_WINDOW)); | 101 EXPECT_TRUE(menu->IsCommandIdEnabled(LauncherContextMenu::MENU_NEW_WINDOW)); |
102 | 102 |
103 // Disable Incognito mode. | 103 // Disable Incognito mode. |
104 IncognitoModePrefs::SetAvailability(profile()->GetPrefs(), | 104 IncognitoModePrefs::SetAvailability(profile()->GetPrefs(), |
105 IncognitoModePrefs::FORCED); | 105 IncognitoModePrefs::FORCED); |
106 menu.reset(CreateLauncherContextMenu(ash::TYPE_BROWSER_SHORTCUT)); | 106 menu.reset(CreateLauncherContextMenu(ash::TYPE_BROWSER_SHORTCUT)); |
107 ASSERT_TRUE(IsItemPresentInMenu( | 107 ASSERT_TRUE(IsItemPresentInMenu( |
108 menu.get(), LauncherContextMenu::MENU_NEW_WINDOW)); | 108 menu.get(), LauncherContextMenu::MENU_NEW_WINDOW)); |
109 EXPECT_FALSE(menu->IsCommandIdEnabled(LauncherContextMenu::MENU_NEW_WINDOW)); | 109 EXPECT_FALSE(menu->IsCommandIdEnabled(LauncherContextMenu::MENU_NEW_WINDOW)); |
110 } | 110 } |
OLD | NEW |