| 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/launcher/launcher.h" | 7 #include "ash/launcher/launcher.h" |
| 8 #include "ash/launcher/launcher_model.h" | 8 #include "ash/launcher/launcher_model.h" |
| 9 #include "ash/launcher/launcher_types.h" | 9 #include "ash/launcher/launcher_types.h" |
| 10 #include "base/prefs/pref_service.h" |
| 10 #include "chrome/app/chrome_command_ids.h" | 11 #include "chrome/app/chrome_command_ids.h" |
| 11 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 12 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
| 12 #include "chrome/browser/prefs/pref_service.h" | |
| 13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
| 14 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" | 14 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
| 15 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_browser.
h" | 15 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_browser.
h" |
| 16 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 16 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
| 17 #include "chrome/test/base/testing_profile.h" | 17 #include "chrome/test/base/testing_profile.h" |
| 18 #include "content/public/test/test_browser_thread.h" | 18 #include "content/public/test/test_browser_thread.h" |
| 19 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
| 20 #include "ui/aura/root_window.h" | 20 #include "ui/aura/root_window.h" |
| 21 | 21 |
| 22 class TestChromeLauncherControllerPerBrowser : | 22 class TestChromeLauncherControllerPerBrowser : |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 EXPECT_TRUE(menu->IsCommandIdEnabled(LauncherContextMenu::MENU_NEW_WINDOW)); | 106 EXPECT_TRUE(menu->IsCommandIdEnabled(LauncherContextMenu::MENU_NEW_WINDOW)); |
| 107 | 107 |
| 108 // Disable Incognito mode. | 108 // Disable Incognito mode. |
| 109 IncognitoModePrefs::SetAvailability(profile()->GetPrefs(), | 109 IncognitoModePrefs::SetAvailability(profile()->GetPrefs(), |
| 110 IncognitoModePrefs::FORCED); | 110 IncognitoModePrefs::FORCED); |
| 111 menu.reset(CreateLauncherContextMenu(ash::TYPE_BROWSER_SHORTCUT)); | 111 menu.reset(CreateLauncherContextMenu(ash::TYPE_BROWSER_SHORTCUT)); |
| 112 ASSERT_TRUE(IsItemPresentInMenu( | 112 ASSERT_TRUE(IsItemPresentInMenu( |
| 113 menu.get(), LauncherContextMenu::MENU_NEW_WINDOW)); | 113 menu.get(), LauncherContextMenu::MENU_NEW_WINDOW)); |
| 114 EXPECT_FALSE(menu->IsCommandIdEnabled(LauncherContextMenu::MENU_NEW_WINDOW)); | 114 EXPECT_FALSE(menu->IsCommandIdEnabled(LauncherContextMenu::MENU_NEW_WINDOW)); |
| 115 } | 115 } |
| OLD | NEW |