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

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

Issue 1296663003: Componentize proxy code from chrome/browser/net (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updating for win p/f Created 5 years, 3 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
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/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
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 #include "chrome/common/pref_names.h" 67 #include "chrome/common/pref_names.h"
68 #include "chrome/common/url_constants.h" 68 #include "chrome/common/url_constants.h"
69 #include "chrome/grit/chromium_strings.h" 69 #include "chrome/grit/chromium_strings.h"
70 #include "chrome/grit/generated_resources.h" 70 #include "chrome/grit/generated_resources.h"
71 #include "chrome/grit/locale_settings.h" 71 #include "chrome/grit/locale_settings.h"
72 #include "components/password_manager/core/browser/password_bubble_experiment.h" 72 #include "components/password_manager/core/browser/password_bubble_experiment.h"
73 #include "components/policy/core/common/policy_map.h" 73 #include "components/policy/core/common/policy_map.h"
74 #include "components/policy/core/common/policy_namespace.h" 74 #include "components/policy/core/common/policy_namespace.h"
75 #include "components/policy/core/common/policy_service.h" 75 #include "components/policy/core/common/policy_service.h"
76 #include "components/proximity_auth/switches.h" 76 #include "components/proximity_auth/switches.h"
77 #include "components/proxy_config/proxy_config_pref_names.h"
77 #include "components/search_engines/template_url.h" 78 #include "components/search_engines/template_url.h"
78 #include "components/search_engines/template_url_service.h" 79 #include "components/search_engines/template_url_service.h"
79 #include "components/signin/core/browser/signin_manager.h" 80 #include "components/signin/core/browser/signin_manager.h"
80 #include "components/signin/core/common/profile_management_switches.h" 81 #include "components/signin/core/common/profile_management_switches.h"
81 #include "components/ui/zoom/page_zoom.h" 82 #include "components/ui/zoom/page_zoom.h"
82 #include "components/user_manager/user_type.h" 83 #include "components/user_manager/user_type.h"
83 #include "content/public/browser/browser_thread.h" 84 #include "content/public/browser/browser_thread.h"
84 #include "content/public/browser/download_manager.h" 85 #include "content/public/browser/download_manager.h"
85 #include "content/public/browser/navigation_controller.h" 86 #include "content/public/browser/navigation_controller.h"
86 #include "content/public/browser/notification_details.h" 87 #include "content/public/browser/notification_details.h"
(...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after
976 policy::key::kWallpaperImage, 977 policy::key::kWallpaperImage,
977 base::Bind(&BrowserOptionsHandler::OnWallpaperPolicyChanged, 978 base::Bind(&BrowserOptionsHandler::OnWallpaperPolicyChanged,
978 base::Unretained(this))); 979 base::Unretained(this)));
979 } 980 }
980 chromeos::CrosSettings::Get()->AddSettingsObserver( 981 chromeos::CrosSettings::Get()->AddSettingsObserver(
981 chromeos::kSystemTimezonePolicy, 982 chromeos::kSystemTimezonePolicy,
982 base::Bind(&BrowserOptionsHandler::OnSystemTimezonePolicyChanged, 983 base::Bind(&BrowserOptionsHandler::OnSystemTimezonePolicyChanged,
983 weak_ptr_factory_.GetWeakPtr())); 984 weak_ptr_factory_.GetWeakPtr()));
984 #else // !defined(OS_CHROMEOS) 985 #else // !defined(OS_CHROMEOS)
985 profile_pref_registrar_.Add( 986 profile_pref_registrar_.Add(
986 prefs::kProxy, 987 proxy_config::prefs::kProxy,
987 base::Bind(&BrowserOptionsHandler::SetupProxySettingsSection, 988 base::Bind(&BrowserOptionsHandler::SetupProxySettingsSection,
988 base::Unretained(this))); 989 base::Unretained(this)));
989 #endif // !defined(OS_CHROMEOS) 990 #endif // !defined(OS_CHROMEOS)
990 } 991 }
991 992
992 void BrowserOptionsHandler::InitializePage() { 993 void BrowserOptionsHandler::InitializePage() {
993 page_initialized_ = true; 994 page_initialized_ = true;
994 995
995 OnTemplateURLServiceChanged(); 996 OnTemplateURLServiceChanged();
996 997
(...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after
2039 // by an extension, or the browser is running in Windows Ash (on Windows the 2040 // by an extension, or the browser is running in Windows Ash (on Windows the
2040 // proxy settings dialog will open on the Windows desktop and be invisible 2041 // proxy settings dialog will open on the Windows desktop and be invisible
2041 // to a user in Ash). 2042 // to a user in Ash).
2042 bool is_win_ash = false; 2043 bool is_win_ash = false;
2043 #if defined(OS_WIN) 2044 #if defined(OS_WIN)
2044 chrome::HostDesktopType desktop_type = helper::GetDesktopType(web_ui()); 2045 chrome::HostDesktopType desktop_type = helper::GetDesktopType(web_ui());
2045 is_win_ash = (desktop_type == chrome::HOST_DESKTOP_TYPE_ASH); 2046 is_win_ash = (desktop_type == chrome::HOST_DESKTOP_TYPE_ASH);
2046 #endif 2047 #endif
2047 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); 2048 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs();
2048 const PrefService::Preference* proxy_config = 2049 const PrefService::Preference* proxy_config =
2049 pref_service->FindPreference(prefs::kProxy); 2050 pref_service->FindPreference(proxy_config::prefs::kProxy);
2050 bool is_extension_controlled = (proxy_config && 2051 bool is_extension_controlled = (proxy_config &&
2051 proxy_config->IsExtensionControlled()); 2052 proxy_config->IsExtensionControlled());
2052 2053
2053 base::FundamentalValue disabled(is_win_ash || (proxy_config && 2054 base::FundamentalValue disabled(is_win_ash || (proxy_config &&
2054 !proxy_config->IsUserModifiable())); 2055 !proxy_config->IsUserModifiable()));
2055 base::FundamentalValue extension_controlled(is_extension_controlled); 2056 base::FundamentalValue extension_controlled(is_extension_controlled);
2056 web_ui()->CallJavascriptFunction("BrowserOptions.setupProxySettingsButton", 2057 web_ui()->CallJavascriptFunction("BrowserOptions.setupProxySettingsButton",
2057 disabled, extension_controlled); 2058 disabled, extension_controlled);
2058 2059
2059 #if defined(OS_WIN) 2060 #if defined(OS_WIN)
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
2177 void BrowserOptionsHandler::OnPolicyUpdated(const policy::PolicyNamespace& ns, 2178 void BrowserOptionsHandler::OnPolicyUpdated(const policy::PolicyNamespace& ns,
2178 const policy::PolicyMap& previous, 2179 const policy::PolicyMap& previous,
2179 const policy::PolicyMap& current) { 2180 const policy::PolicyMap& current) {
2180 std::set<std::string> different_keys; 2181 std::set<std::string> different_keys;
2181 current.GetDifferingKeys(previous, &different_keys); 2182 current.GetDifferingKeys(previous, &different_keys);
2182 if (ContainsKey(different_keys, policy::key::kMetricsReportingEnabled)) 2183 if (ContainsKey(different_keys, policy::key::kMetricsReportingEnabled))
2183 SetupMetricsReportingCheckbox(); 2184 SetupMetricsReportingCheckbox();
2184 } 2185 }
2185 2186
2186 } // namespace options 2187 } // namespace options
OLDNEW
« no previous file with comments | « chrome/browser/ui/prefs/prefs_tab_helper.cc ('k') | chrome/browser/ui/webui/options/chromeos/core_chromeos_options_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698