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 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
52 #include "chrome/browser/signin/easy_unlock_service.h" | 52 #include "chrome/browser/signin/easy_unlock_service.h" |
53 #include "chrome/browser/signin/signin_manager_factory.h" | 53 #include "chrome/browser/signin/signin_manager_factory.h" |
54 #include "chrome/browser/sync/profile_sync_service.h" | 54 #include "chrome/browser/sync/profile_sync_service.h" |
55 #include "chrome/browser/sync/profile_sync_service_factory.h" | 55 #include "chrome/browser/sync/profile_sync_service_factory.h" |
56 #include "chrome/browser/sync/sync_ui_util.h" | 56 #include "chrome/browser/sync/sync_ui_util.h" |
57 #include "chrome/browser/themes/theme_service.h" | 57 #include "chrome/browser/themes/theme_service.h" |
58 #include "chrome/browser/themes/theme_service_factory.h" | 58 #include "chrome/browser/themes/theme_service_factory.h" |
59 #include "chrome/browser/ui/browser_finder.h" | 59 #include "chrome/browser/ui/browser_finder.h" |
60 #include "chrome/browser/ui/chrome_select_file_policy.h" | 60 #include "chrome/browser/ui/chrome_select_file_policy.h" |
61 #include "chrome/browser/ui/host_desktop.h" | 61 #include "chrome/browser/ui/host_desktop.h" |
62 #include "chrome/browser/ui/webui/fallback_icon_source.h" | |
62 #include "chrome/browser/ui/webui/favicon_source.h" | 63 #include "chrome/browser/ui/webui/favicon_source.h" |
63 #include "chrome/browser/ui/webui/options/options_handlers_helper.h" | 64 #include "chrome/browser/ui/webui/options/options_handlers_helper.h" |
64 #include "chrome/common/chrome_constants.h" | 65 #include "chrome/common/chrome_constants.h" |
65 #include "chrome/common/chrome_paths.h" | 66 #include "chrome/common/chrome_paths.h" |
66 #include "chrome/common/chrome_switches.h" | 67 #include "chrome/common/chrome_switches.h" |
67 #include "chrome/common/extensions/extension_constants.h" | 68 #include "chrome/common/extensions/extension_constants.h" |
68 #include "chrome/common/pref_names.h" | 69 #include "chrome/common/pref_names.h" |
69 #include "chrome/common/url_constants.h" | 70 #include "chrome/common/url_constants.h" |
70 #include "chrome/grit/chromium_strings.h" | 71 #include "chrome/grit/chromium_strings.h" |
71 #include "chrome/grit/generated_resources.h" | 72 #include "chrome/grit/generated_resources.h" |
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
849 ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile)); | 850 ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile)); |
850 // TODO(blundell): Use a ScopedObserver to observe the PSS so that cleanup on | 851 // TODO(blundell): Use a ScopedObserver to observe the PSS so that cleanup on |
851 // destruction is automatic. | 852 // destruction is automatic. |
852 if (sync_service) | 853 if (sync_service) |
853 sync_service->AddObserver(this); | 854 sync_service->AddObserver(this); |
854 | 855 |
855 SigninManagerBase* signin_manager( | 856 SigninManagerBase* signin_manager( |
856 SigninManagerFactory::GetInstance()->GetForProfile(profile)); | 857 SigninManagerFactory::GetInstance()->GetForProfile(profile)); |
857 if (signin_manager) | 858 if (signin_manager) |
858 signin_observer_.Add(signin_manager); | 859 signin_observer_.Add(signin_manager); |
859 | 860 |
pkotwicz
2015/01/21 19:44:15
Remove this too
huangs
2015/01/22 01:13:27
Done.
| |
861 // Create our fallback icon data source. | |
862 content::URLDataSource::Add(profile, new FallbackIconSource()); | |
860 // Create our favicon data source. | 863 // Create our favicon data source. |
861 content::URLDataSource::Add( | 864 content::URLDataSource::Add( |
862 profile, new FaviconSource(profile, FaviconSource::FAVICON)); | 865 profile, new FaviconSource(profile, FaviconSource::FAVICON)); |
863 | 866 |
864 default_browser_policy_.Init( | 867 default_browser_policy_.Init( |
865 prefs::kDefaultBrowserSettingEnabled, | 868 prefs::kDefaultBrowserSettingEnabled, |
866 g_browser_process->local_state(), | 869 g_browser_process->local_state(), |
867 base::Bind(&BrowserOptionsHandler::UpdateDefaultBrowserState, | 870 base::Bind(&BrowserOptionsHandler::UpdateDefaultBrowserState, |
868 base::Unretained(this))); | 871 base::Unretained(this))); |
869 | 872 |
(...skipping 1241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2111 void BrowserOptionsHandler::OnPolicyUpdated(const policy::PolicyNamespace& ns, | 2114 void BrowserOptionsHandler::OnPolicyUpdated(const policy::PolicyNamespace& ns, |
2112 const policy::PolicyMap& previous, | 2115 const policy::PolicyMap& previous, |
2113 const policy::PolicyMap& current) { | 2116 const policy::PolicyMap& current) { |
2114 std::set<std::string> different_keys; | 2117 std::set<std::string> different_keys; |
2115 current.GetDifferingKeys(previous, &different_keys); | 2118 current.GetDifferingKeys(previous, &different_keys); |
2116 if (ContainsKey(different_keys, policy::key::kMetricsReportingEnabled)) | 2119 if (ContainsKey(different_keys, policy::key::kMetricsReportingEnabled)) |
2117 SetupMetricsReportingCheckbox(); | 2120 SetupMetricsReportingCheckbox(); |
2118 } | 2121 } |
2119 | 2122 |
2120 } // namespace options | 2123 } // namespace options |
OLD | NEW |