| 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/test_chrome_browser_state.h" | 5 #include "ios/chrome/browser/browser_state/test_chrome_browser_state.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 std::unique_ptr<KeyedService> BuildBookmarkModel(web::BrowserState* context) { | 65 std::unique_ptr<KeyedService> BuildBookmarkModel(web::BrowserState* context) { |
| 66 ios::ChromeBrowserState* browser_state = | 66 ios::ChromeBrowserState* browser_state = |
| 67 ios::ChromeBrowserState::FromBrowserState(context); | 67 ios::ChromeBrowserState::FromBrowserState(context); |
| 68 std::unique_ptr<bookmarks::BookmarkModel> bookmark_model( | 68 std::unique_ptr<bookmarks::BookmarkModel> bookmark_model( |
| 69 new bookmarks::BookmarkModel( | 69 new bookmarks::BookmarkModel( |
| 70 base::MakeUnique<BookmarkClientImpl>(browser_state))); | 70 base::MakeUnique<BookmarkClientImpl>(browser_state))); |
| 71 bookmark_model->Load( | 71 bookmark_model->Load( |
| 72 browser_state->GetPrefs(), | 72 browser_state->GetPrefs(), |
| 73 browser_state->GetStatePath(), browser_state->GetIOTaskRunner(), | 73 browser_state->GetStatePath(), browser_state->GetIOTaskRunner(), |
| 74 web::WebThread::GetTaskRunnerForThread(web::WebThread::UI)); | 74 web::WebThread::GetTaskRunnerForThread(web::WebThread::UI)); |
| 75 // TODO(crbug.com/703565): remove std::move() once Xcode 9.0+ is required. |
| 75 return std::move(bookmark_model); | 76 return std::move(bookmark_model); |
| 76 } | 77 } |
| 77 | 78 |
| 78 void NotReachedErrorCallback(WebDataServiceWrapper::ErrorType, | 79 void NotReachedErrorCallback(WebDataServiceWrapper::ErrorType, |
| 79 sql::InitStatus, | 80 sql::InitStatus, |
| 80 const std::string&) { | 81 const std::string&) { |
| 81 NOTREACHED(); | 82 NOTREACHED(); |
| 82 } | 83 } |
| 83 | 84 |
| 84 std::unique_ptr<KeyedService> BuildWebDataService(web::BrowserState* context) { | 85 std::unique_ptr<KeyedService> BuildWebDataService(web::BrowserState* context) { |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 pref_service_ = std::move(prefs); | 417 pref_service_ = std::move(prefs); |
| 417 } | 418 } |
| 418 | 419 |
| 419 std::unique_ptr<TestChromeBrowserState> | 420 std::unique_ptr<TestChromeBrowserState> |
| 420 TestChromeBrowserState::Builder::Build() { | 421 TestChromeBrowserState::Builder::Build() { |
| 421 DCHECK(!build_called_); | 422 DCHECK(!build_called_); |
| 422 return base::WrapUnique(new TestChromeBrowserState( | 423 return base::WrapUnique(new TestChromeBrowserState( |
| 423 state_path_, std::move(pref_service_), testing_factories_, | 424 state_path_, std::move(pref_service_), testing_factories_, |
| 424 refcounted_testing_factories_)); | 425 refcounted_testing_factories_)); |
| 425 } | 426 } |
| OLD | NEW |