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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 #include "components/content_settings/core/common/content_settings_pattern.h" | 91 #include "components/content_settings/core/common/content_settings_pattern.h" |
92 #include "components/infobars/core/infobar.h" | 92 #include "components/infobars/core/infobar.h" |
93 #include "components/omnibox/browser/autocomplete_controller.h" | 93 #include "components/omnibox/browser/autocomplete_controller.h" |
94 #include "components/policy/core/browser/browser_policy_connector.h" | 94 #include "components/policy/core/browser/browser_policy_connector.h" |
95 #include "components/policy/core/common/external_data_fetcher.h" | 95 #include "components/policy/core/common/external_data_fetcher.h" |
96 #include "components/policy/core/common/mock_configuration_policy_provider.h" | 96 #include "components/policy/core/common/mock_configuration_policy_provider.h" |
97 #include "components/policy/core/common/policy_map.h" | 97 #include "components/policy/core/common/policy_map.h" |
98 #include "components/policy/core/common/policy_pref_names.h" | 98 #include "components/policy/core/common/policy_pref_names.h" |
99 #include "components/policy/core/common/policy_service.h" | 99 #include "components/policy/core/common/policy_service.h" |
100 #include "components/policy/core/common/policy_service_impl.h" | 100 #include "components/policy/core/common/policy_service_impl.h" |
| 101 #include "components/search/search.h" |
101 #include "components/search_engines/template_url.h" | 102 #include "components/search_engines/template_url.h" |
102 #include "components/search_engines/template_url_service.h" | 103 #include "components/search_engines/template_url_service.h" |
103 #include "components/translate/core/browser/language_state.h" | 104 #include "components/translate/core/browser/language_state.h" |
104 #include "components/translate/core/browser/translate_infobar_delegate.h" | 105 #include "components/translate/core/browser/translate_infobar_delegate.h" |
105 #include "content/public/browser/browser_child_process_host_iterator.h" | 106 #include "content/public/browser/browser_child_process_host_iterator.h" |
106 #include "content/public/browser/browser_context.h" | 107 #include "content/public/browser/browser_context.h" |
107 #include "content/public/browser/browser_thread.h" | 108 #include "content/public/browser/browser_thread.h" |
108 #include "content/public/browser/child_process_data.h" | 109 #include "content/public/browser/child_process_data.h" |
109 #include "content/public/browser/download_item.h" | 110 #include "content/public/browser/download_item.h" |
110 #include "content/public/browser/download_manager.h" | 111 #include "content/public/browser/download_manager.h" |
(...skipping 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1173 EXPECT_EQ(youtube == 1 || legacy_enabled, | 1174 EXPECT_EQ(youtube == 1 || legacy_enabled, |
1174 prefs->GetBoolean(prefs::kForceYouTubeSafetyMode)); | 1175 prefs->GetBoolean(prefs::kForceYouTubeSafetyMode)); |
1175 | 1176 |
1176 CheckSafeSearch(google == 1 || legacy_enabled); | 1177 CheckSafeSearch(google == 1 || legacy_enabled); |
1177 } | 1178 } |
1178 } | 1179 } |
1179 | 1180 |
1180 IN_PROC_BROWSER_TEST_F(PolicyTest, ReplaceSearchTerms) { | 1181 IN_PROC_BROWSER_TEST_F(PolicyTest, ReplaceSearchTerms) { |
1181 MakeRequestFail make_request_fail("search.example"); | 1182 MakeRequestFail make_request_fail("search.example"); |
1182 | 1183 |
1183 chrome::EnableQueryExtractionForTesting(); | 1184 search::EnableQueryExtractionForTesting(); |
1184 | 1185 |
1185 // Verifies that a default search is made using the provider configured via | 1186 // Verifies that a default search is made using the provider configured via |
1186 // policy. Also checks that default search can be completely disabled. | 1187 // policy. Also checks that default search can be completely disabled. |
1187 const base::string16 kKeyword(base::ASCIIToUTF16("testsearch")); | 1188 const base::string16 kKeyword(base::ASCIIToUTF16("testsearch")); |
1188 const std::string kSearchURL("https://www.google.com/search?q={searchTerms}"); | 1189 const std::string kSearchURL("https://www.google.com/search?q={searchTerms}"); |
1189 const std::string kInstantURL("http://does/not/exist"); | 1190 const std::string kInstantURL("http://does/not/exist"); |
1190 const std::string kAlternateURL0( | 1191 const std::string kAlternateURL0( |
1191 "https://www.google.com/search#q={searchTerms}"); | 1192 "https://www.google.com/search#q={searchTerms}"); |
1192 const std::string kAlternateURL1("https://www.google.com/#q={searchTerms}"); | 1193 const std::string kAlternateURL1("https://www.google.com/#q={searchTerms}"); |
1193 const std::string kSearchTermsReplacementKey( | 1194 const std::string kSearchTermsReplacementKey( |
(...skipping 2666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3860 | 3861 |
3861 IN_PROC_BROWSER_TEST_F(HardwareAccelerationModePolicyTest, | 3862 IN_PROC_BROWSER_TEST_F(HardwareAccelerationModePolicyTest, |
3862 HardwareAccelerationDisabled) { | 3863 HardwareAccelerationDisabled) { |
3863 // Verifies that hardware acceleration can be disabled with policy. | 3864 // Verifies that hardware acceleration can be disabled with policy. |
3864 EXPECT_FALSE( | 3865 EXPECT_FALSE( |
3865 content::GpuDataManager::GetInstance()->GpuAccessAllowed(nullptr)); | 3866 content::GpuDataManager::GetInstance()->GpuAccessAllowed(nullptr)); |
3866 } | 3867 } |
3867 #endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID) | 3868 #endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID) |
3868 | 3869 |
3869 } // namespace policy | 3870 } // namespace policy |
OLD | NEW |