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/profiles/profile_impl.h" | 5 #include "chrome/browser/profiles/profile_impl.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 #include "components/content_settings/core/browser/host_content_settings_map.h" | 84 #include "components/content_settings/core/browser/host_content_settings_map.h" |
85 #include "components/domain_reliability/monitor.h" | 85 #include "components/domain_reliability/monitor.h" |
86 #include "components/domain_reliability/service.h" | 86 #include "components/domain_reliability/service.h" |
87 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 87 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
88 #include "components/metrics/metrics_service.h" | 88 #include "components/metrics/metrics_service.h" |
89 #include "components/omnibox/browser/autocomplete_classifier.h" | 89 #include "components/omnibox/browser/autocomplete_classifier.h" |
90 #include "components/omnibox/browser/shortcuts_backend.h" | 90 #include "components/omnibox/browser/shortcuts_backend.h" |
91 #include "components/pref_registry/pref_registry_syncable.h" | 91 #include "components/pref_registry/pref_registry_syncable.h" |
92 #include "components/signin/core/browser/signin_manager.h" | 92 #include "components/signin/core/browser/signin_manager.h" |
93 #include "components/ui/zoom/zoom_event_manager.h" | 93 #include "components/ui/zoom/zoom_event_manager.h" |
94 #include "components/url_fixer/url_fixer.h" | 94 #include "components/url_formatter/url_fixer.h" |
95 #include "components/user_prefs/user_prefs.h" | 95 #include "components/user_prefs/user_prefs.h" |
96 #include "content/public/browser/browser_thread.h" | 96 #include "content/public/browser/browser_thread.h" |
97 #include "content/public/browser/dom_storage_context.h" | 97 #include "content/public/browser/dom_storage_context.h" |
98 #include "content/public/browser/notification_service.h" | 98 #include "content/public/browser/notification_service.h" |
99 #include "content/public/browser/render_process_host.h" | 99 #include "content/public/browser/render_process_host.h" |
100 #include "content/public/browser/storage_partition.h" | 100 #include "content/public/browser/storage_partition.h" |
101 #include "content/public/browser/url_data_source.h" | 101 #include "content/public/browser/url_data_source.h" |
102 #include "content/public/browser/user_metrics.h" | 102 #include "content/public/browser/user_metrics.h" |
103 #include "content/public/common/content_constants.h" | 103 #include "content/public/common/content_constants.h" |
104 #include "content/public/common/page_zoom.h" | 104 #include "content/public/common/page_zoom.h" |
(...skipping 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1201 const base::CommandLine& command_line = | 1201 const base::CommandLine& command_line = |
1202 *base::CommandLine::ForCurrentProcess(); | 1202 *base::CommandLine::ForCurrentProcess(); |
1203 if (command_line.HasSwitch(switches::kHomePage)) { | 1203 if (command_line.HasSwitch(switches::kHomePage)) { |
1204 // TODO(evanm): clean up usage of DIR_CURRENT. | 1204 // TODO(evanm): clean up usage of DIR_CURRENT. |
1205 // http://code.google.com/p/chromium/issues/detail?id=60630 | 1205 // http://code.google.com/p/chromium/issues/detail?id=60630 |
1206 // For now, allow this code to call getcwd(). | 1206 // For now, allow this code to call getcwd(). |
1207 base::ThreadRestrictions::ScopedAllowIO allow_io; | 1207 base::ThreadRestrictions::ScopedAllowIO allow_io; |
1208 | 1208 |
1209 base::FilePath browser_directory; | 1209 base::FilePath browser_directory; |
1210 PathService::Get(base::DIR_CURRENT, &browser_directory); | 1210 PathService::Get(base::DIR_CURRENT, &browser_directory); |
1211 GURL home_page(url_fixer::FixupRelativeFile( | 1211 GURL home_page(url_formatter::FixupRelativeFile( |
1212 browser_directory, | 1212 browser_directory, |
1213 command_line.GetSwitchValuePath(switches::kHomePage))); | 1213 command_line.GetSwitchValuePath(switches::kHomePage))); |
1214 if (home_page.is_valid()) | 1214 if (home_page.is_valid()) |
1215 return home_page; | 1215 return home_page; |
1216 } | 1216 } |
1217 | 1217 |
1218 if (GetPrefs()->GetBoolean(prefs::kHomePageIsNewTabPage)) | 1218 if (GetPrefs()->GetBoolean(prefs::kHomePageIsNewTabPage)) |
1219 return GURL(chrome::kChromeUINewTabURL); | 1219 return GURL(chrome::kChromeUINewTabURL); |
1220 GURL home_page(url_fixer::FixupURL(GetPrefs()->GetString(prefs::kHomePage), | 1220 GURL home_page(url_formatter::FixupURL( |
1221 std::string())); | 1221 GetPrefs()->GetString(prefs::kHomePage), std::string())); |
1222 if (!home_page.is_valid()) | 1222 if (!home_page.is_valid()) |
1223 return GURL(chrome::kChromeUINewTabURL); | 1223 return GURL(chrome::kChromeUINewTabURL); |
1224 return home_page; | 1224 return home_page; |
1225 } | 1225 } |
1226 | 1226 |
1227 void ProfileImpl::UpdateProfileSupervisedUserIdCache() { | 1227 void ProfileImpl::UpdateProfileSupervisedUserIdCache() { |
1228 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 1228 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
1229 ProfileInfoCache& cache = profile_manager->GetProfileInfoCache(); | 1229 ProfileInfoCache& cache = profile_manager->GetProfileInfoCache(); |
1230 size_t index = cache.GetIndexOfProfileWithPath(GetPath()); | 1230 size_t index = cache.GetIndexOfProfileWithPath(GetPath()); |
1231 if (index != std::string::npos) { | 1231 if (index != std::string::npos) { |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1309 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { | 1309 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { |
1310 domain_reliability::DomainReliabilityService* service = | 1310 domain_reliability::DomainReliabilityService* service = |
1311 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> | 1311 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> |
1312 GetForBrowserContext(this); | 1312 GetForBrowserContext(this); |
1313 if (!service) | 1313 if (!service) |
1314 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); | 1314 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); |
1315 | 1315 |
1316 return service->CreateMonitor( | 1316 return service->CreateMonitor( |
1317 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); | 1317 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); |
1318 } | 1318 } |
OLD | NEW |