Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(627)

Side by Side Diff: components/policy/core/browser/browser_policy_connector.cc

Issue 1737453003: Revert of Reland: No longer start up profile if there was an error fetching policy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chromeos/chromeos_switches.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "components/policy/core/browser/browser_policy_connector.h" 5 #include "components/policy/core/browser/browser_policy_connector.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <algorithm> 8 #include <algorithm>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 24 matching lines...) Expand all
35 // The URL for the device management server. 35 // The URL for the device management server.
36 const char kDefaultDeviceManagementServerUrl[] = 36 const char kDefaultDeviceManagementServerUrl[] =
37 "https://m.google.com/devicemanagement/data/api"; 37 "https://m.google.com/devicemanagement/data/api";
38 38
39 39
40 void ReportRegexSuccessMetric(bool success) { 40 void ReportRegexSuccessMetric(bool success) {
41 UMA_HISTOGRAM_BOOLEAN("Enterprise.DomainWhitelistRegexSuccess", success); 41 UMA_HISTOGRAM_BOOLEAN("Enterprise.DomainWhitelistRegexSuccess", success);
42 } 42 }
43 43
44 // Regexes that match many of the larger public email providers as we know 44 // Regexes that match many of the larger public email providers as we know
45 // these users are not from hosted enterprise domains. 45 // these users are not from hosted enterprise domains. Keep this list in sync
46 // with the EnterpriseDomainRegex enum in histograms.xml (i.e. only add things
47 // at the end).
46 const wchar_t* const kNonManagedDomainPatterns[] = { 48 const wchar_t* const kNonManagedDomainPatterns[] = {
47 L"aol\\.com", 49 L"aol\\.com",
48 L"googlemail\\.com", 50 L"googlemail\\.com",
49 L"gmail\\.com", 51 L"gmail\\.com",
50 L"hotmail(\\.co|\\.com|)\\.[^.]+", // hotmail.com, hotmail.it, hotmail.co.uk 52 L"hotmail(\\.co|\\.com|)\\.[^.]+", // hotmail.com, hotmail.it, hotmail.co.uk
51 L"live\\.com", 53 L"live\\.com",
52 L"mail\\.ru", 54 L"mail\\.ru",
53 L"msn\\.com", 55 L"msn\\.com",
54 L"qq\\.com", 56 L"qq\\.com",
55 L"yahoo(\\.co|\\.com|)\\.[^.]+", // yahoo.com, yahoo.co.uk, yahoo.com.tw 57 L"yahoo(\\.co|\\.com|)\\.[^.]+", // yahoo.com, yahoo.co.uk, yahoo.com.tw
56 L"yandex\\.ru", 58 L"yandex\\.ru",
57 L"consumer\\.example\\.com",
58 }; 59 };
59 60
60 // Returns true if |domain| matches the regex |pattern|. 61 // Returns true if |domain| matches the regex |pattern|.
61 bool MatchDomain(const base::string16& domain, const base::string16& pattern, 62 bool MatchDomain(const base::string16& domain, const base::string16& pattern,
62 size_t index) { 63 size_t index) {
63 UErrorCode status = U_ZERO_ERROR; 64 UErrorCode status = U_ZERO_ERROR;
64 const icu::UnicodeString icu_pattern(pattern.data(), pattern.length()); 65 const icu::UnicodeString icu_pattern(pattern.data(), pattern.length());
65 icu::RegexMatcher matcher(icu_pattern, UREGEX_CASE_INSENSITIVE, status); 66 icu::RegexMatcher matcher(icu_pattern, UREGEX_CASE_INSENSITIVE, status);
66 if (!U_SUCCESS(status)) { 67 if (!U_SUCCESS(status)) {
67 // http://crbug.com/365351 - if for some reason the matcher creation fails 68 // http://crbug.com/365351 - if for some reason the matcher creation fails
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 157
157 // static 158 // static
158 void BrowserPolicyConnector::RegisterPrefs(PrefRegistrySimple* registry) { 159 void BrowserPolicyConnector::RegisterPrefs(PrefRegistrySimple* registry) {
159 registry->RegisterIntegerPref( 160 registry->RegisterIntegerPref(
160 policy_prefs::kUserPolicyRefreshRate, 161 policy_prefs::kUserPolicyRefreshRate,
161 CloudPolicyRefreshScheduler::kDefaultRefreshDelayMs); 162 CloudPolicyRefreshScheduler::kDefaultRefreshDelayMs);
162 } 163 }
163 164
164 165
165 } // namespace policy 166 } // namespace policy
OLDNEW
« no previous file with comments | « chromeos/chromeos_switches.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698