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

Side by Side Diff: chrome/browser/ui/webui/options/core_options_handler.cc

Issue 365253004: Move options_util.* into chrome/browser/metrics. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
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/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"
11 #include "base/strings/string16.h" 11 #include "base/strings/string16.h"
12 #include "base/strings/string_number_conversions.h" 12 #include "base/strings/string_number_conversions.h"
13 #include "base/strings/utf_string_conversions.h" 13 #include "base/strings/utf_string_conversions.h"
14 #include "base/values.h" 14 #include "base/values.h"
15 #include "chrome/browser/browser_process.h" 15 #include "chrome/browser/browser_process.h"
16 #include "chrome/browser/chrome_notification_types.h" 16 #include "chrome/browser/chrome_notification_types.h"
17 #include "chrome/browser/extensions/extension_service.h" 17 #include "chrome/browser/extensions/extension_service.h"
18 #include "chrome/browser/extensions/extension_util.h" 18 #include "chrome/browser/extensions/extension_util.h"
19 #include "chrome/browser/metrics/metrics_reporting_state.h"
19 #include "chrome/browser/profiles/profile.h" 20 #include "chrome/browser/profiles/profile.h"
20 #include "chrome/browser/ui/options/options_util.h"
21 #include "chrome/common/pref_names.h" 21 #include "chrome/common/pref_names.h"
22 #include "chrome/common/url_constants.h" 22 #include "chrome/common/url_constants.h"
23 #include "components/url_fixer/url_fixer.h" 23 #include "components/url_fixer/url_fixer.h"
24 #include "content/public/browser/notification_details.h" 24 #include "content/public/browser/notification_details.h"
25 #include "content/public/browser/notification_types.h" 25 #include "content/public/browser/notification_types.h"
26 #include "content/public/browser/user_metrics.h" 26 #include "content/public/browser/user_metrics.h"
27 #include "content/public/browser/web_ui.h" 27 #include "content/public/browser/web_ui.h"
28 #include "extensions/browser/extension_pref_value_map.h" 28 #include "extensions/browser/extension_pref_value_map.h"
29 #include "extensions/browser/extension_pref_value_map_factory.h" 29 #include "extensions/browser/extension_pref_value_map_factory.h"
30 #include "extensions/browser/extension_registry.h" 30 #include "extensions/browser/extension_registry.h"
(...skipping 14 matching lines...) Expand all
45 45
46 // Only allow changes to the metrics reporting checkbox if we were succesfully 46 // Only allow changes to the metrics reporting checkbox if we were succesfully
47 // able to change the service. 47 // able to change the service.
48 bool AllowMetricsReportingChange(const base::Value* to_value) { 48 bool AllowMetricsReportingChange(const base::Value* to_value) {
49 bool enable; 49 bool enable;
50 if (!to_value->GetAsBoolean(&enable)) { 50 if (!to_value->GetAsBoolean(&enable)) {
51 NOTREACHED(); 51 NOTREACHED();
52 return false; 52 return false;
53 } 53 }
54 54
55 return enable == OptionsUtil::ResolveMetricsReportingEnabled(enable); 55 return enable == ResolveMetricsReportingEnabled(enable);
56 } 56 }
57 57
58 // Whether "controlledBy" property of pref value sent to options web UI needs to 58 // Whether "controlledBy" property of pref value sent to options web UI needs to
59 // be set to "extension" when the preference is controlled by an extension. 59 // be set to "extension" when the preference is controlled by an extension.
60 bool CanSetExtensionControlledPrefValue( 60 bool CanSetExtensionControlledPrefValue(
61 const PrefService::Preference* preference) { 61 const PrefService::Preference* preference) {
62 #if defined(OS_WIN) 62 #if defined(OS_WIN)
63 // These have more obvious UI than the standard one for extension controlled 63 // These have more obvious UI than the standard one for extension controlled
64 // values (an extension puzzle piece) on the settings page. To avoiding 64 // values (an extension puzzle piece) on the settings page. To avoiding
65 // showing the extension puzzle piece for these settings, their "controlledBy" 65 // showing the extension puzzle piece for these settings, their "controlledBy"
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 } 651 }
652 652
653 void CoreOptionsHandler::UpdatePepperFlashSettingsEnabled() { 653 void CoreOptionsHandler::UpdatePepperFlashSettingsEnabled() {
654 base::FundamentalValue enabled( 654 base::FundamentalValue enabled(
655 plugin_status_pref_setter_.IsPepperFlashSettingsEnabled()); 655 plugin_status_pref_setter_.IsPepperFlashSettingsEnabled());
656 web_ui()->CallJavascriptFunction( 656 web_ui()->CallJavascriptFunction(
657 "OptionsPage.setPepperFlashSettingsEnabled", enabled); 657 "OptionsPage.setPepperFlashSettingsEnabled", enabled);
658 } 658 }
659 659
660 } // namespace options 660 } // namespace options
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698