| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <string> | 6 #include <string> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 #include "chrome/browser/policy/profile_policy_connector.h" | 49 #include "chrome/browser/policy/profile_policy_connector.h" |
| 50 #include "chrome/browser/policy/profile_policy_connector_factory.h" | 50 #include "chrome/browser/policy/profile_policy_connector_factory.h" |
| 51 #include "chrome/browser/prefs/session_startup_pref.h" | 51 #include "chrome/browser/prefs/session_startup_pref.h" |
| 52 #include "chrome/browser/profiles/profile.h" | 52 #include "chrome/browser/profiles/profile.h" |
| 53 #include "chrome/browser/search/instant_service.h" | 53 #include "chrome/browser/search/instant_service.h" |
| 54 #include "chrome/browser/search/instant_service_factory.h" | 54 #include "chrome/browser/search/instant_service_factory.h" |
| 55 #include "chrome/browser/search/search.h" | 55 #include "chrome/browser/search/search.h" |
| 56 #include "chrome/browser/search_engines/template_url.h" | 56 #include "chrome/browser/search_engines/template_url.h" |
| 57 #include "chrome/browser/search_engines/template_url_service.h" | 57 #include "chrome/browser/search_engines/template_url_service.h" |
| 58 #include "chrome/browser/search_engines/template_url_service_factory.h" | 58 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 59 #include "chrome/browser/translate/translate_browser_test_utils.h" |
| 59 #include "chrome/browser/translate/translate_infobar_delegate.h" | 60 #include "chrome/browser/translate/translate_infobar_delegate.h" |
| 60 #include "chrome/browser/translate/translate_service.h" | 61 #include "chrome/browser/translate/translate_service.h" |
| 61 #include "chrome/browser/translate/translate_tab_helper.h" | 62 #include "chrome/browser/translate/translate_tab_helper.h" |
| 62 #include "chrome/browser/ui/bookmarks/bookmark_bar.h" | 63 #include "chrome/browser/ui/bookmarks/bookmark_bar.h" |
| 63 #include "chrome/browser/ui/browser.h" | 64 #include "chrome/browser/ui/browser.h" |
| 64 #include "chrome/browser/ui/browser_commands.h" | 65 #include "chrome/browser/ui/browser_commands.h" |
| 65 #include "chrome/browser/ui/browser_list.h" | 66 #include "chrome/browser/ui/browser_list.h" |
| 66 #include "chrome/browser/ui/browser_tabstrip.h" | 67 #include "chrome/browser/ui/browser_tabstrip.h" |
| 67 #include "chrome/browser/ui/browser_window.h" | 68 #include "chrome/browser/ui/browser_window.h" |
| 68 #include "chrome/browser/ui/host_desktop.h" | 69 #include "chrome/browser/ui/host_desktop.h" |
| (...skipping 1786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1855 UpdateProviderPolicy(policies); | 1856 UpdateProviderPolicy(policies); |
| 1856 ui_test_utils::NavigateToURL(browser(), url); | 1857 ui_test_utils::NavigateToURL(browser(), url); |
| 1857 // Verify that the navigation was saved in the history. | 1858 // Verify that the navigation was saved in the history. |
| 1858 ui_test_utils::HistoryEnumerator enumerator2(browser()->profile()); | 1859 ui_test_utils::HistoryEnumerator enumerator2(browser()->profile()); |
| 1859 ASSERT_EQ(1u, enumerator2.urls().size()); | 1860 ASSERT_EQ(1u, enumerator2.urls().size()); |
| 1860 EXPECT_EQ(url, enumerator2.urls()[0]); | 1861 EXPECT_EQ(url, enumerator2.urls()[0]); |
| 1861 } | 1862 } |
| 1862 | 1863 |
| 1863 // http://crbug.com/241691 PolicyTest.TranslateEnabled is failing regularly. | 1864 // http://crbug.com/241691 PolicyTest.TranslateEnabled is failing regularly. |
| 1864 IN_PROC_BROWSER_TEST_F(PolicyTest, DISABLED_TranslateEnabled) { | 1865 IN_PROC_BROWSER_TEST_F(PolicyTest, DISABLED_TranslateEnabled) { |
| 1866 test::ScopedCLDDynamicDataHarness dynamic_data_scope; |
| 1867 ASSERT_NO_FATAL_FAILURE(dynamic_data_scope.Init()); |
| 1865 TranslateService::SetUseInfobar(true); | 1868 TranslateService::SetUseInfobar(true); |
| 1866 | 1869 |
| 1867 // Verifies that translate can be forced enabled or disabled by policy. | 1870 // Verifies that translate can be forced enabled or disabled by policy. |
| 1868 | 1871 |
| 1869 // Get the InfoBarService, and verify that there are no infobars on startup. | 1872 // Get the InfoBarService, and verify that there are no infobars on startup. |
| 1870 content::WebContents* contents = | 1873 content::WebContents* contents = |
| 1871 browser()->tab_strip_model()->GetActiveWebContents(); | 1874 browser()->tab_strip_model()->GetActiveWebContents(); |
| 1872 ASSERT_TRUE(contents); | 1875 ASSERT_TRUE(contents); |
| 1873 InfoBarService* infobar_service = InfoBarService::FromWebContents(contents); | 1876 InfoBarService* infobar_service = InfoBarService::FromWebContents(contents); |
| 1874 ASSERT_TRUE(infobar_service); | 1877 ASSERT_TRUE(infobar_service); |
| (...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2967 PrefService* prefs = browser()->profile()->GetPrefs(); | 2970 PrefService* prefs = browser()->profile()->GetPrefs(); |
| 2968 EXPECT_TRUE(extensions::NativeMessageProcessHost::IsHostAllowed( | 2971 EXPECT_TRUE(extensions::NativeMessageProcessHost::IsHostAllowed( |
| 2969 prefs, "host.name")); | 2972 prefs, "host.name")); |
| 2970 EXPECT_FALSE(extensions::NativeMessageProcessHost::IsHostAllowed( | 2973 EXPECT_FALSE(extensions::NativeMessageProcessHost::IsHostAllowed( |
| 2971 prefs, "other.host.name")); | 2974 prefs, "other.host.name")); |
| 2972 } | 2975 } |
| 2973 | 2976 |
| 2974 #endif // !defined(CHROME_OS) | 2977 #endif // !defined(CHROME_OS) |
| 2975 | 2978 |
| 2976 } // namespace policy | 2979 } // namespace policy |
| OLD | NEW |