OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "ios/chrome/browser/browser_state/chrome_browser_state_impl.h" | 5 #include "ios/chrome/browser/browser_state/chrome_browser_state_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/synchronization/waitable_event.h" | 12 #include "base/synchronization/waitable_event.h" |
13 #include "components/bookmarks/browser/bookmark_model.h" | 13 #include "components/bookmarks/browser/bookmark_model.h" |
14 #include "components/keyed_service/ios/browser_state_dependency_manager.h" | 14 #include "components/keyed_service/ios/browser_state_dependency_manager.h" |
15 #include "components/pref_registry/pref_registry_syncable.h" | 15 #include "components/pref_registry/pref_registry_syncable.h" |
16 #include "components/prefs/json_pref_store.h" | 16 #include "components/prefs/json_pref_store.h" |
17 #include "components/prefs/pref_service.h" | 17 #include "components/prefs/pref_service.h" |
| 18 #include "components/proxy_config/ios/proxy_service_factory.h" |
18 #include "components/proxy_config/pref_proxy_config_tracker.h" | 19 #include "components/proxy_config/pref_proxy_config_tracker.h" |
19 #include "components/sync_preferences/pref_service_syncable.h" | 20 #include "components/sync_preferences/pref_service_syncable.h" |
20 #include "components/user_prefs/user_prefs.h" | 21 #include "components/user_prefs/user_prefs.h" |
21 #include "ios/chrome/browser/application_context.h" | 22 #include "ios/chrome/browser/application_context.h" |
22 #include "ios/chrome/browser/bookmarks/bookmark_model_factory.h" | 23 #include "ios/chrome/browser/bookmarks/bookmark_model_factory.h" |
23 #include "ios/chrome/browser/browser_state/bookmark_model_loaded_observer.h" | 24 #include "ios/chrome/browser/browser_state/bookmark_model_loaded_observer.h" |
24 #include "ios/chrome/browser/browser_state/off_the_record_chrome_browser_state_i
mpl.h" | 25 #include "ios/chrome/browser/browser_state/off_the_record_chrome_browser_state_i
mpl.h" |
25 #include "ios/chrome/browser/chrome_constants.h" | 26 #include "ios/chrome/browser/chrome_constants.h" |
26 #include "ios/chrome/browser/chrome_paths_internal.h" | 27 #include "ios/chrome/browser/chrome_paths_internal.h" |
27 #include "ios/chrome/browser/file_metadata_util.h" | 28 #include "ios/chrome/browser/file_metadata_util.h" |
28 #include "ios/chrome/browser/net/ios_chrome_url_request_context_getter.h" | 29 #include "ios/chrome/browser/net/ios_chrome_url_request_context_getter.h" |
29 #include "ios/chrome/browser/net/proxy_service_factory.h" | |
30 #include "ios/chrome/browser/pref_names.h" | 30 #include "ios/chrome/browser/pref_names.h" |
31 #include "ios/chrome/browser/prefs/browser_prefs.h" | 31 #include "ios/chrome/browser/prefs/browser_prefs.h" |
32 #include "ios/chrome/browser/prefs/ios_chrome_pref_service_factory.h" | 32 #include "ios/chrome/browser/prefs/ios_chrome_pref_service_factory.h" |
33 #include "ios/web/public/web_thread.h" | 33 #include "ios/web/public/web_thread.h" |
34 | 34 |
35 namespace { | 35 namespace { |
36 | 36 |
37 // Returns a bool indicating whether the necessary directories were able to be | 37 // Returns a bool indicating whether the necessary directories were able to be |
38 // created (or already existed). | 38 // created (or already existed). |
39 bool EnsureBrowserStateDirectoriesCreated(const base::FilePath& path, | 39 bool EnsureBrowserStateDirectoriesCreated(const base::FilePath& path, |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 | 236 |
237 void ChromeBrowserStateImpl::ClearNetworkingHistorySince( | 237 void ChromeBrowserStateImpl::ClearNetworkingHistorySince( |
238 base::Time time, | 238 base::Time time, |
239 const base::Closure& completion) { | 239 const base::Closure& completion) { |
240 io_data_->ClearNetworkingHistorySince(time, completion); | 240 io_data_->ClearNetworkingHistorySince(time, completion); |
241 } | 241 } |
242 | 242 |
243 PrefProxyConfigTracker* ChromeBrowserStateImpl::GetProxyConfigTracker() { | 243 PrefProxyConfigTracker* ChromeBrowserStateImpl::GetProxyConfigTracker() { |
244 if (!pref_proxy_config_tracker_) { | 244 if (!pref_proxy_config_tracker_) { |
245 pref_proxy_config_tracker_ = | 245 pref_proxy_config_tracker_ = |
246 ios::ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( | 246 ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( |
247 GetPrefs(), GetApplicationContext()->GetLocalState()); | 247 GetPrefs(), GetApplicationContext()->GetLocalState()); |
248 } | 248 } |
249 return pref_proxy_config_tracker_.get(); | 249 return pref_proxy_config_tracker_.get(); |
250 } | 250 } |
251 | 251 |
252 net::SSLConfigService* ChromeBrowserStateImpl::GetSSLConfigService() { | 252 net::SSLConfigService* ChromeBrowserStateImpl::GetSSLConfigService() { |
253 // If ssl_config_service_manager_ is null, this typically means that some | 253 // If ssl_config_service_manager_ is null, this typically means that some |
254 // KeyedService is trying to create a RequestContext at startup, | 254 // KeyedService is trying to create a RequestContext at startup, |
255 // but SSLConfigServiceManager is not initialized until DoFinalInit() which is | 255 // but SSLConfigServiceManager is not initialized until DoFinalInit() which is |
256 // invoked after all KeyedServices have been initialized (see | 256 // invoked after all KeyedServices have been initialized (see |
257 // http://crbug.com/171406). | 257 // http://crbug.com/171406). |
258 DCHECK(ssl_config_service_manager_) | 258 DCHECK(ssl_config_service_manager_) |
259 << "SSLConfigServiceManager is not initialized yet"; | 259 << "SSLConfigServiceManager is not initialized yet"; |
260 return ssl_config_service_manager_->Get(); | 260 return ssl_config_service_manager_->Get(); |
261 } | 261 } |
OLD | NEW |