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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "ui/base/l10n/l10n_util.h" | 30 #include "ui/base/l10n/l10n_util.h" |
31 | 31 |
32 using content::UserMetricsAction; | 32 using content::UserMetricsAction; |
33 | 33 |
34 CoreOptionsHandler::CoreOptionsHandler() | 34 CoreOptionsHandler::CoreOptionsHandler() |
35 : handlers_host_(NULL) { | 35 : handlers_host_(NULL) { |
36 } | 36 } |
37 | 37 |
38 CoreOptionsHandler::~CoreOptionsHandler() {} | 38 CoreOptionsHandler::~CoreOptionsHandler() {} |
39 | 39 |
40 void CoreOptionsHandler::Initialize() { | 40 void CoreOptionsHandler::InitializeHandler() { |
41 clear_plugin_lso_data_enabled_.Init(prefs::kClearPluginLSODataEnabled, | 41 clear_plugin_lso_data_enabled_.Init(prefs::kClearPluginLSODataEnabled, |
42 Profile::FromWebUI(web_ui()), | 42 Profile::FromWebUI(web_ui()), |
43 this); | 43 this); |
44 UpdateClearPluginLSOData(); | 44 UpdateClearPluginLSOData(); |
45 } | 45 } |
46 | 46 |
47 void CoreOptionsHandler::GetLocalizedValues( | 47 void CoreOptionsHandler::GetLocalizedValues( |
48 DictionaryValue* localized_strings) { | 48 DictionaryValue* localized_strings) { |
49 GetStaticLocalizedValues(localized_strings); | 49 GetStaticLocalizedValues(localized_strings); |
50 } | 50 } |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 content::RecordComputedAction(metric); | 448 content::RecordComputedAction(metric); |
449 } | 449 } |
450 | 450 |
451 void CoreOptionsHandler::UpdateClearPluginLSOData() { | 451 void CoreOptionsHandler::UpdateClearPluginLSOData() { |
452 scoped_ptr<base::Value> enabled( | 452 scoped_ptr<base::Value> enabled( |
453 base::Value::CreateBooleanValue( | 453 base::Value::CreateBooleanValue( |
454 clear_plugin_lso_data_enabled_.GetValue())); | 454 clear_plugin_lso_data_enabled_.GetValue())); |
455 web_ui()->CallJavascriptFunction( | 455 web_ui()->CallJavascriptFunction( |
456 "OptionsPage.setClearPluginLSODataEnabled", *enabled); | 456 "OptionsPage.setClearPluginLSODataEnabled", *enabled); |
457 } | 457 } |
OLD | NEW |