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

Side by Side Diff: chrome/browser/extensions/api/settings_private/prefs_util.cc

Issue 1425093004: Revert of This CL replaces user_manager::UserID with AccountId. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@468875--Chrome-OS-handles-deletion-of-Gmail-account-poorly--Create-AccountID-structure-part2--user_names
Patch Set: Created 5 years, 1 month 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/extensions/api/settings_private/prefs_util.h" 5 #include "chrome/browser/extensions/api/settings_private/prefs_util.h"
6 6
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/extensions/chrome_extension_function.h" 9 #include "chrome/browser/extensions/chrome_extension_function.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 #if defined(OS_CHROMEOS) 276 #if defined(OS_CHROMEOS)
277 if (IsPrefOwnerControlled(name)) { 277 if (IsPrefOwnerControlled(name)) {
278 // Check for owner controlled after managed checks because if there is a 278 // Check for owner controlled after managed checks because if there is a
279 // device policy there is no "owner". (In the unlikely case that both 279 // device policy there is no "owner". (In the unlikely case that both
280 // situations apply, either badge is potentially relevant, so the order 280 // situations apply, either badge is potentially relevant, so the order
281 // is somewhat arbitrary). 281 // is somewhat arbitrary).
282 pref_object->policy_source = 282 pref_object->policy_source =
283 settings_private::PolicySource::POLICY_SOURCE_OWNER; 283 settings_private::PolicySource::POLICY_SOURCE_OWNER;
284 pref_object->policy_enforcement = 284 pref_object->policy_enforcement =
285 settings_private::PolicyEnforcement::POLICY_ENFORCEMENT_ENFORCED; 285 settings_private::PolicyEnforcement::POLICY_ENFORCEMENT_ENFORCED;
286 pref_object->policy_source_name.reset(new std::string( 286 pref_object->policy_source_name.reset(
287 user_manager::UserManager::Get()->GetOwnerAccountId().GetUserEmail())); 287 new std::string(user_manager::UserManager::Get()->GetOwnerEmail()));
288 return pref_object.Pass(); 288 return pref_object.Pass();
289 } 289 }
290 #endif 290 #endif
291 291
292 if (pref && pref->IsExtensionControlled()) { 292 if (pref && pref->IsExtensionControlled()) {
293 std::string extension_id = 293 std::string extension_id =
294 ExtensionPrefValueMapFactory::GetForBrowserContext(profile_) 294 ExtensionPrefValueMapFactory::GetForBrowserContext(profile_)
295 ->GetExtensionControllingPref(pref->name()); 295 ->GetExtensionControllingPref(pref->name());
296 const Extension* extension = ExtensionRegistry::Get(profile_)-> 296 const Extension* extension = ExtensionRegistry::Get(profile_)->
297 GetExtensionById(extension_id, ExtensionRegistry::ENABLED); 297 GetExtensionById(extension_id, ExtensionRegistry::ENABLED);
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 518
519 bool PrefsUtil::IsCrosSetting(const std::string& pref_name) { 519 bool PrefsUtil::IsCrosSetting(const std::string& pref_name) {
520 #if defined(OS_CHROMEOS) 520 #if defined(OS_CHROMEOS)
521 return CrosSettings::Get()->IsCrosSettings(pref_name); 521 return CrosSettings::Get()->IsCrosSettings(pref_name);
522 #else 522 #else
523 return false; 523 return false;
524 #endif 524 #endif
525 } 525 }
526 526
527 } // namespace extensions 527 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698