| 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/browser_options_handler.h" | 5 #include "chrome/browser/ui/webui/options/browser_options_handler.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/bind_helpers.h" | 12 #include "base/bind_helpers.h" |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/environment.h" | 14 #include "base/environment.h" |
| 15 #include "base/memory/singleton.h" | 15 #include "base/memory/singleton.h" |
| 16 #include "base/metrics/field_trial.h" | 16 #include "base/metrics/field_trial.h" |
| 17 #include "base/metrics/histogram.h" | 17 #include "base/metrics/histogram.h" |
| 18 #include "base/prefs/pref_service.h" | 18 #include "base/prefs/pref_service.h" |
| 19 #include "base/prefs/scoped_user_pref_update.h" | 19 #include "base/prefs/scoped_user_pref_update.h" |
| 20 #include "base/stl_util.h" | 20 #include "base/stl_util.h" |
| 21 #include "base/strings/string_number_conversions.h" | 21 #include "base/strings/string_number_conversions.h" |
| 22 #include "base/strings/utf_string_conversions.h" | 22 #include "base/strings/utf_string_conversions.h" |
| 23 #include "base/value_conversions.h" | 23 #include "base/value_conversions.h" |
| 24 #include "base/values.h" | 24 #include "base/values.h" |
| 25 #include "chrome/browser/auto_launch_trial.h" | 25 #include "chrome/browser/auto_launch_trial.h" |
| 26 #include "chrome/browser/browser_process.h" | 26 #include "chrome/browser/browser_process.h" |
| 27 #include "chrome/browser/chrome_notification_types.h" | 27 #include "chrome/browser/chrome_notification_types.h" |
| 28 #include "chrome/browser/chrome_page_zoom.h" | |
| 29 #include "chrome/browser/custom_home_pages_table_model.h" | 28 #include "chrome/browser/custom_home_pages_table_model.h" |
| 30 #include "chrome/browser/download/download_prefs.h" | 29 #include "chrome/browser/download/download_prefs.h" |
| 31 #include "chrome/browser/gpu/gpu_mode_manager.h" | 30 #include "chrome/browser/gpu/gpu_mode_manager.h" |
| 32 #include "chrome/browser/lifetime/application_lifetime.h" | 31 #include "chrome/browser/lifetime/application_lifetime.h" |
| 33 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" | 32 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" |
| 34 #include "chrome/browser/metrics/metrics_reporting_state.h" | 33 #include "chrome/browser/metrics/metrics_reporting_state.h" |
| 35 #include "chrome/browser/net/prediction_options.h" | 34 #include "chrome/browser/net/prediction_options.h" |
| 36 #include "chrome/browser/prefs/session_startup_pref.h" | 35 #include "chrome/browser/prefs/session_startup_pref.h" |
| 37 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" | 36 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" |
| 38 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.
h" | 37 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.
h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 #include "chrome/grit/locale_settings.h" | 71 #include "chrome/grit/locale_settings.h" |
| 73 #include "chromeos/chromeos_switches.h" | 72 #include "chromeos/chromeos_switches.h" |
| 74 #include "components/policy/core/common/policy_map.h" | 73 #include "components/policy/core/common/policy_map.h" |
| 75 #include "components/policy/core/common/policy_namespace.h" | 74 #include "components/policy/core/common/policy_namespace.h" |
| 76 #include "components/policy/core/common/policy_service.h" | 75 #include "components/policy/core/common/policy_service.h" |
| 77 #include "components/proximity_auth/switches.h" | 76 #include "components/proximity_auth/switches.h" |
| 78 #include "components/search_engines/template_url.h" | 77 #include "components/search_engines/template_url.h" |
| 79 #include "components/search_engines/template_url_service.h" | 78 #include "components/search_engines/template_url_service.h" |
| 80 #include "components/signin/core/browser/signin_manager.h" | 79 #include "components/signin/core/browser/signin_manager.h" |
| 81 #include "components/signin/core/common/profile_management_switches.h" | 80 #include "components/signin/core/common/profile_management_switches.h" |
| 81 #include "components/ui/zoom/page_zoom.h" |
| 82 #include "components/user_manager/user_type.h" | 82 #include "components/user_manager/user_type.h" |
| 83 #include "content/public/browser/browser_thread.h" | 83 #include "content/public/browser/browser_thread.h" |
| 84 #include "content/public/browser/download_manager.h" | 84 #include "content/public/browser/download_manager.h" |
| 85 #include "content/public/browser/navigation_controller.h" | 85 #include "content/public/browser/navigation_controller.h" |
| 86 #include "content/public/browser/notification_details.h" | 86 #include "content/public/browser/notification_details.h" |
| 87 #include "content/public/browser/notification_service.h" | 87 #include "content/public/browser/notification_service.h" |
| 88 #include "content/public/browser/notification_source.h" | 88 #include "content/public/browser/notification_source.h" |
| 89 #include "content/public/browser/notification_types.h" | 89 #include "content/public/browser/notification_types.h" |
| 90 #include "content/public/browser/url_data_source.h" | 90 #include "content/public/browser/url_data_source.h" |
| 91 #include "content/public/browser/user_metrics.h" | 91 #include "content/public/browser/user_metrics.h" |
| (...skipping 1827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1919 void BrowserOptionsHandler::SetupPageZoomSelector() { | 1919 void BrowserOptionsHandler::SetupPageZoomSelector() { |
| 1920 double default_zoom_level = | 1920 double default_zoom_level = |
| 1921 content::HostZoomMap::GetDefaultForBrowserContext( | 1921 content::HostZoomMap::GetDefaultForBrowserContext( |
| 1922 Profile::FromWebUI(web_ui()))->GetDefaultZoomLevel(); | 1922 Profile::FromWebUI(web_ui()))->GetDefaultZoomLevel(); |
| 1923 double default_zoom_factor = | 1923 double default_zoom_factor = |
| 1924 content::ZoomLevelToZoomFactor(default_zoom_level); | 1924 content::ZoomLevelToZoomFactor(default_zoom_level); |
| 1925 | 1925 |
| 1926 // Generate a vector of zoom factors from an array of known presets along with | 1926 // Generate a vector of zoom factors from an array of known presets along with |
| 1927 // the default factor added if necessary. | 1927 // the default factor added if necessary. |
| 1928 std::vector<double> zoom_factors = | 1928 std::vector<double> zoom_factors = |
| 1929 chrome_page_zoom::PresetZoomFactors(default_zoom_factor); | 1929 ui_zoom::PageZoom::PresetZoomFactors(default_zoom_factor); |
| 1930 | 1930 |
| 1931 // Iterate through the zoom factors and and build the contents of the | 1931 // Iterate through the zoom factors and and build the contents of the |
| 1932 // selector that will be sent to the javascript handler. | 1932 // selector that will be sent to the javascript handler. |
| 1933 // Each item in the list has the following parameters: | 1933 // Each item in the list has the following parameters: |
| 1934 // 1. Title (string). | 1934 // 1. Title (string). |
| 1935 // 2. Value (double). | 1935 // 2. Value (double). |
| 1936 // 3. Is selected? (bool). | 1936 // 3. Is selected? (bool). |
| 1937 base::ListValue zoom_factors_value; | 1937 base::ListValue zoom_factors_value; |
| 1938 for (std::vector<double>::const_iterator i = zoom_factors.begin(); | 1938 for (std::vector<double>::const_iterator i = zoom_factors.begin(); |
| 1939 i != zoom_factors.end(); ++i) { | 1939 i != zoom_factors.end(); ++i) { |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2111 void BrowserOptionsHandler::OnPolicyUpdated(const policy::PolicyNamespace& ns, | 2111 void BrowserOptionsHandler::OnPolicyUpdated(const policy::PolicyNamespace& ns, |
| 2112 const policy::PolicyMap& previous, | 2112 const policy::PolicyMap& previous, |
| 2113 const policy::PolicyMap& current) { | 2113 const policy::PolicyMap& current) { |
| 2114 std::set<std::string> different_keys; | 2114 std::set<std::string> different_keys; |
| 2115 current.GetDifferingKeys(previous, &different_keys); | 2115 current.GetDifferingKeys(previous, &different_keys); |
| 2116 if (ContainsKey(different_keys, policy::key::kMetricsReportingEnabled)) | 2116 if (ContainsKey(different_keys, policy::key::kMetricsReportingEnabled)) |
| 2117 SetupMetricsReportingCheckbox(); | 2117 SetupMetricsReportingCheckbox(); |
| 2118 } | 2118 } |
| 2119 | 2119 |
| 2120 } // namespace options | 2120 } // namespace options |
| OLD | NEW |