| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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.h" | 5 #include "ios/chrome/browser/browser_state/chrome_browser_state.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/logging.h" | 10 #include "base/logging.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 base::FilePath browser_state_path = | 56 base::FilePath browser_state_path = |
| 57 GetOriginalChromeBrowserState()->GetStatePath(); | 57 GetOriginalChromeBrowserState()->GetStatePath(); |
| 58 return JsonPrefStore::GetTaskRunnerForFile(browser_state_path, | 58 return JsonPrefStore::GetTaskRunnerForFile(browser_state_path, |
| 59 web::WebThread::GetBlockingPool()); | 59 web::WebThread::GetBlockingPool()); |
| 60 } | 60 } |
| 61 | 61 |
| 62 sync_preferences::PrefServiceSyncable* ChromeBrowserState::GetSyncablePrefs() { | 62 sync_preferences::PrefServiceSyncable* ChromeBrowserState::GetSyncablePrefs() { |
| 63 return static_cast<sync_preferences::PrefServiceSyncable*>(GetPrefs()); | 63 return static_cast<sync_preferences::PrefServiceSyncable*>(GetPrefs()); |
| 64 } | 64 } |
| 65 | 65 |
| 66 TestChromeBrowserState* ChromeBrowserState::AsTestChromeBrowserState() { | |
| 67 return nullptr; | |
| 68 } | |
| 69 | |
| 70 net::URLRequestContextGetter* ChromeBrowserState::GetRequestContext() { | 66 net::URLRequestContextGetter* ChromeBrowserState::GetRequestContext() { |
| 71 DCHECK_CURRENTLY_ON(web::WebThread::UI); | 67 DCHECK_CURRENTLY_ON(web::WebThread::UI); |
| 72 if (!request_context_getter_) { | 68 if (!request_context_getter_) { |
| 73 ProtocolHandlerMap protocol_handlers; | 69 ProtocolHandlerMap protocol_handlers; |
| 74 protocol_handlers[kChromeUIScheme] = | 70 protocol_handlers[kChromeUIScheme] = |
| 75 linked_ptr<net::URLRequestJobFactory::ProtocolHandler>( | 71 linked_ptr<net::URLRequestJobFactory::ProtocolHandler>( |
| 76 web::URLDataManagerIOSBackend::CreateProtocolHandler(this) | 72 web::URLDataManagerIOSBackend::CreateProtocolHandler(this) |
| 77 .release()); | 73 .release()); |
| 78 request_context_getter_ = | 74 request_context_getter_ = |
| 79 make_scoped_refptr(CreateRequestContext(&protocol_handlers)); | 75 make_scoped_refptr(CreateRequestContext(&protocol_handlers)); |
| 80 } | 76 } |
| 81 return request_context_getter_.get(); | 77 return request_context_getter_.get(); |
| 82 } | 78 } |
| 83 | 79 |
| 84 } // namespace ios | 80 } // namespace ios |
| OLD | NEW |