OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <memory> | 5 #include <memory> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/base_switches.h" | 8 #include "base/base_switches.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 | 408 |
409 SettingsProtectionLevel GetProtectionLevelFromTrialGroup( | 409 SettingsProtectionLevel GetProtectionLevelFromTrialGroup( |
410 const std::string& trial_group) { | 410 const std::string& trial_group) { |
411 if (!ProfilePrefStoreManager::kPlatformSupportsPreferenceTracking) | 411 if (!ProfilePrefStoreManager::kPlatformSupportsPreferenceTracking) |
412 return PROTECTION_DISABLED_ON_PLATFORM; | 412 return PROTECTION_DISABLED_ON_PLATFORM; |
413 | 413 |
414 // Protection levels can't be adjusted via --force-fieldtrials in official | 414 // Protection levels can't be adjusted via --force-fieldtrials in official |
415 // builds. | 415 // builds. |
416 #if defined(OFFICIAL_BUILD) | 416 #if defined(OFFICIAL_BUILD) |
417 | 417 |
418 #if defined(OS_WIN) | 418 #if defined(OS_WIN) || defined(OS_MACOSX) |
419 // The strongest mode is enforced on Windows in the absence of a field | 419 // The strongest mode is enforced on Windows and MacOS in the absence of a |
420 // trial. | 420 // field trial. |
421 return PROTECTION_ENABLED_ALL; | 421 return PROTECTION_ENABLED_ALL; |
422 #else | 422 #else |
423 return PROTECTION_DISABLED_FOR_GROUP; | 423 return PROTECTION_DISABLED_FOR_GROUP; |
424 #endif | 424 #endif |
425 | 425 |
426 #else // defined(OFFICIAL_BUILD) | 426 #else // defined(OFFICIAL_BUILD) |
427 | 427 |
428 using namespace chrome_prefs::internals; | 428 using namespace chrome_prefs::internals; |
429 if (trial_group == kSettingsEnforcementGroupNoEnforcement) { | 429 if (trial_group == kSettingsEnforcementGroupNoEnforcement) { |
430 return PROTECTION_DISABLED_FOR_GROUP; | 430 return PROTECTION_DISABLED_FOR_GROUP; |
(...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1271 EXPECT_EQ(DefaultSearchManager::FROM_FALLBACK, dse_source); | 1271 EXPECT_EQ(DefaultSearchManager::FROM_FALLBACK, dse_source); |
1272 EXPECT_NE(current_dse->keyword(), base::UTF8ToUTF16("badkeyword")); | 1272 EXPECT_NE(current_dse->keyword(), base::UTF8ToUTF16("badkeyword")); |
1273 EXPECT_NE(current_dse->short_name(), base::UTF8ToUTF16("badname")); | 1273 EXPECT_NE(current_dse->short_name(), base::UTF8ToUTF16("badname")); |
1274 EXPECT_NE(current_dse->url(), | 1274 EXPECT_NE(current_dse->url(), |
1275 "http://bad_default_engine/search?q=dirty_user_query"); | 1275 "http://bad_default_engine/search?q=dirty_user_query"); |
1276 } | 1276 } |
1277 } | 1277 } |
1278 }; | 1278 }; |
1279 | 1279 |
1280 PREF_HASH_BROWSER_TEST(PrefHashBrowserTestDefaultSearch, SearchProtected); | 1280 PREF_HASH_BROWSER_TEST(PrefHashBrowserTestDefaultSearch, SearchProtected); |
OLD | NEW |