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

Side by Side Diff: chrome/browser/profiles/profile.cc

Issue 566933005: Do not display lock for hosted domains (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change to a hosted domain preference. Fix unit tests. Created 6 years, 3 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
OLDNEW
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 "chrome/browser/profiles/profile.h" 5 #include "chrome/browser/profiles/profile.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 TestingProfile* Profile::AsTestingProfile() { 59 TestingProfile* Profile::AsTestingProfile() {
60 return NULL; 60 return NULL;
61 } 61 }
62 62
63 Profile::Delegate::~Delegate() { 63 Profile::Delegate::~Delegate() {
64 } 64 }
65 65
66 // static 66 // static
67 const char Profile::kProfileKey[] = "__PROFILE__"; 67 const char Profile::kProfileKey[] = "__PROFILE__";
68 // This must be a string which can never be a valid domain.
69 const char Profile::kNoHostedDomainFound[] = "NO_HOSTED_DOMAIN";
68 70
69 // static 71 // static
70 void Profile::RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { 72 void Profile::RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
71 registry->RegisterBooleanPref( 73 registry->RegisterBooleanPref(
72 prefs::kSearchSuggestEnabled, 74 prefs::kSearchSuggestEnabled,
73 true, 75 true,
74 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); 76 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
75 #if defined(OS_ANDROID) 77 #if defined(OS_ANDROID)
76 registry->RegisterStringPref( 78 registry->RegisterStringPref(
77 prefs::kContextualSearchEnabled, 79 prefs::kContextualSearchEnabled,
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 "install", 150 "install",
149 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); 151 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
150 registry->RegisterBooleanPref( 152 registry->RegisterBooleanPref(
151 prefs::kSpeechRecognitionFilterProfanities, 153 prefs::kSpeechRecognitionFilterProfanities,
152 true, 154 true,
153 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); 155 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
154 registry->RegisterIntegerPref( 156 registry->RegisterIntegerPref(
155 prefs::kProfileIconVersion, 157 prefs::kProfileIconVersion,
156 0, 158 0,
157 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); 159 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
160 registry->RegisterStringPref(
161 prefs::kProfileHostedDomain,
162 std::string(),
163 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
164 registry->RegisterIntegerPref(
165 prefs::kProfileIsLockableVersion,
166 0,
167 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
158 #if defined(OS_CHROMEOS) 168 #if defined(OS_CHROMEOS)
159 // TODO(dilmah): For OS_CHROMEOS we maintain kApplicationLocale in both 169 // TODO(dilmah): For OS_CHROMEOS we maintain kApplicationLocale in both
160 // local state and user's profile. For other platforms we maintain 170 // local state and user's profile. For other platforms we maintain
161 // kApplicationLocale only in local state. 171 // kApplicationLocale only in local state.
162 // In the future we may want to maintain kApplicationLocale 172 // In the future we may want to maintain kApplicationLocale
163 // in user's profile for other platforms as well. 173 // in user's profile for other platforms as well.
164 registry->RegisterStringPref( 174 registry->RegisterStringPref(
165 prefs::kApplicationLocale, 175 prefs::kApplicationLocale,
166 std::string(), 176 std::string(),
167 user_prefs::PrefRegistrySyncable::SYNCABLE_PRIORITY_PREF); 177 user_prefs::PrefRegistrySyncable::SYNCABLE_PRIORITY_PREF);
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 content::NotificationService::NoDetails()); 253 content::NotificationService::NoDetails());
244 } 254 }
245 } 255 }
246 256
247 bool ProfileCompare::operator()(Profile* a, Profile* b) const { 257 bool ProfileCompare::operator()(Profile* a, Profile* b) const {
248 DCHECK(a && b); 258 DCHECK(a && b);
249 if (a->IsSameProfile(b)) 259 if (a->IsSameProfile(b))
250 return false; 260 return false;
251 return a->GetOriginalProfile() < b->GetOriginalProfile(); 261 return a->GetOriginalProfile() < b->GetOriginalProfile();
252 } 262 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698