| OLD | NEW |
| 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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 #if defined(OS_CHROMEOS) | 256 #if defined(OS_CHROMEOS) |
| 257 if (IsPrefOwnerControlled(name)) { | 257 if (IsPrefOwnerControlled(name)) { |
| 258 // Check for owner controlled after managed checks because if there is a | 258 // Check for owner controlled after managed checks because if there is a |
| 259 // device policy there is no "owner". (In the unlikely case that both | 259 // device policy there is no "owner". (In the unlikely case that both |
| 260 // situations apply, either badge is potentially relevant, so the order | 260 // situations apply, either badge is potentially relevant, so the order |
| 261 // is somewhat arbitrary). | 261 // is somewhat arbitrary). |
| 262 pref_object->policy_source = | 262 pref_object->policy_source = |
| 263 settings_private::PolicySource::POLICY_SOURCE_OWNER; | 263 settings_private::PolicySource::POLICY_SOURCE_OWNER; |
| 264 pref_object->policy_enforcement = | 264 pref_object->policy_enforcement = |
| 265 settings_private::PolicyEnforcement::POLICY_ENFORCEMENT_ENFORCED; | 265 settings_private::PolicyEnforcement::POLICY_ENFORCEMENT_ENFORCED; |
| 266 pref_object->policy_source_name.reset( | 266 pref_object->policy_source_name.reset(new std::string( |
| 267 new std::string(user_manager::UserManager::Get()->GetOwnerEmail())); | 267 user_manager::UserManager::Get()->GetOwnerAccountId().GetUserEmail())); |
| 268 return pref_object.Pass(); | 268 return pref_object.Pass(); |
| 269 } | 269 } |
| 270 #endif | 270 #endif |
| 271 | 271 |
| 272 if (pref && pref->IsExtensionControlled()) { | 272 if (pref && pref->IsExtensionControlled()) { |
| 273 std::string extension_id = | 273 std::string extension_id = |
| 274 ExtensionPrefValueMapFactory::GetForBrowserContext(profile_) | 274 ExtensionPrefValueMapFactory::GetForBrowserContext(profile_) |
| 275 ->GetExtensionControllingPref(pref->name()); | 275 ->GetExtensionControllingPref(pref->name()); |
| 276 const Extension* extension = ExtensionRegistry::Get(profile_)-> | 276 const Extension* extension = ExtensionRegistry::Get(profile_)-> |
| 277 GetExtensionById(extension_id, ExtensionRegistry::ENABLED); | 277 GetExtensionById(extension_id, ExtensionRegistry::ENABLED); |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 | 497 |
| 498 bool PrefsUtil::IsCrosSetting(const std::string& pref_name) { | 498 bool PrefsUtil::IsCrosSetting(const std::string& pref_name) { |
| 499 #if defined(OS_CHROMEOS) | 499 #if defined(OS_CHROMEOS) |
| 500 return CrosSettings::Get()->IsCrosSettings(pref_name); | 500 return CrosSettings::Get()->IsCrosSettings(pref_name); |
| 501 #else | 501 #else |
| 502 return false; | 502 return false; |
| 503 #endif | 503 #endif |
| 504 } | 504 } |
| 505 | 505 |
| 506 } // namespace extensions | 506 } // namespace extensions |
| OLD | NEW |