| OLD | NEW |
| 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/ui/webui/options/core_options_handler.h" | 5 #include "chrome/browser/ui/webui/options/core_options_handler.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 } | 365 } |
| 366 | 366 |
| 367 base::Value* CoreOptionsHandler::CreateValueForPref( | 367 base::Value* CoreOptionsHandler::CreateValueForPref( |
| 368 const std::string& pref_name, | 368 const std::string& pref_name, |
| 369 const std::string& controlling_pref_name) { | 369 const std::string& controlling_pref_name) { |
| 370 const PrefService* pref_service = FindServiceForPref(pref_name); | 370 const PrefService* pref_service = FindServiceForPref(pref_name); |
| 371 const PrefService::Preference* pref = | 371 const PrefService::Preference* pref = |
| 372 pref_service->FindPreference(pref_name); | 372 pref_service->FindPreference(pref_name); |
| 373 if (!pref) { | 373 if (!pref) { |
| 374 NOTREACHED(); | 374 NOTREACHED(); |
| 375 return base::Value::CreateNullValue().release(); | 375 return new base::Value(); |
| 376 } | 376 } |
| 377 const PrefService::Preference* controlling_pref = | 377 const PrefService::Preference* controlling_pref = |
| 378 pref_service->FindPreference(controlling_pref_name); | 378 pref_service->FindPreference(controlling_pref_name); |
| 379 if (!controlling_pref) | 379 if (!controlling_pref) |
| 380 controlling_pref = pref; | 380 controlling_pref = pref; |
| 381 | 381 |
| 382 base::DictionaryValue* dict = new base::DictionaryValue; | 382 base::DictionaryValue* dict = new base::DictionaryValue; |
| 383 dict->Set("value", pref->GetValue()->DeepCopy()); | 383 dict->Set("value", pref->GetValue()->DeepCopy()); |
| 384 if (controlling_pref->IsManaged()) { | 384 if (controlling_pref->IsManaged()) { |
| 385 dict->SetString("controlledBy", "policy"); | 385 dict->SetString("controlledBy", "policy"); |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 plugin_status_pref_setter_.IsPepperFlashSettingsEnabled()); | 654 plugin_status_pref_setter_.IsPepperFlashSettingsEnabled()); |
| 655 web_ui()->CallJavascriptFunctionUnsafe( | 655 web_ui()->CallJavascriptFunctionUnsafe( |
| 656 "options.OptionsPage.setPepperFlashSettingsEnabled", enabled); | 656 "options.OptionsPage.setPepperFlashSettingsEnabled", enabled); |
| 657 } | 657 } |
| 658 | 658 |
| 659 bool CoreOptionsHandler::IsUserUnsupervised(const base::Value* to_value) { | 659 bool CoreOptionsHandler::IsUserUnsupervised(const base::Value* to_value) { |
| 660 return !Profile::FromWebUI(web_ui())->IsSupervised(); | 660 return !Profile::FromWebUI(web_ui())->IsSupervised(); |
| 661 } | 661 } |
| 662 | 662 |
| 663 } // namespace options | 663 } // namespace options |
| OLD | NEW |