OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/bookmarks/bookmark_model_factory.h" | 5 #include "ios/chrome/browser/bookmarks/bookmark_model_factory.h" |
6 | 6 |
| 7 #include <utility> |
| 8 |
7 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
8 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
9 #include "components/bookmarks/browser/bookmark_model.h" | 11 #include "components/bookmarks/browser/bookmark_model.h" |
10 #include "components/bookmarks/browser/bookmark_utils.h" | 12 #include "components/bookmarks/browser/bookmark_utils.h" |
11 #include "components/bookmarks/browser/startup_task_runner_service.h" | 13 #include "components/bookmarks/browser/startup_task_runner_service.h" |
12 #include "components/keyed_service/ios/browser_state_dependency_manager.h" | 14 #include "components/keyed_service/ios/browser_state_dependency_manager.h" |
13 #include "components/undo/bookmark_undo_service.h" | 15 #include "components/undo/bookmark_undo_service.h" |
14 #include "ios/chrome/browser/bookmarks/bookmark_client_factory.h" | 16 #include "ios/chrome/browser/bookmarks/bookmark_client_factory.h" |
15 #include "ios/chrome/browser/bookmarks/bookmark_client_impl.h" | 17 #include "ios/chrome/browser/bookmarks/bookmark_client_impl.h" |
16 #include "ios/chrome/browser/bookmarks/startup_task_runner_service_factory.h" | 18 #include "ios/chrome/browser/bookmarks/startup_task_runner_service_factory.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 new bookmarks::BookmarkModel(bookmark_client)); | 70 new bookmarks::BookmarkModel(bookmark_client)); |
69 bookmark_model->Load( | 71 bookmark_model->Load( |
70 browser_state->GetPrefs(), | 72 browser_state->GetPrefs(), |
71 browser_state->GetPrefs()->GetString(prefs::kAcceptLanguages), | 73 browser_state->GetPrefs()->GetString(prefs::kAcceptLanguages), |
72 browser_state->GetStatePath(), | 74 browser_state->GetStatePath(), |
73 ios::StartupTaskRunnerServiceFactory::GetForBrowserState(browser_state) | 75 ios::StartupTaskRunnerServiceFactory::GetForBrowserState(browser_state) |
74 ->GetBookmarkTaskRunner(), | 76 ->GetBookmarkTaskRunner(), |
75 web::WebThread::GetTaskRunnerForThread(web::WebThread::UI)); | 77 web::WebThread::GetTaskRunnerForThread(web::WebThread::UI)); |
76 ios::BookmarkUndoServiceFactory::GetForBrowserState(browser_state) | 78 ios::BookmarkUndoServiceFactory::GetForBrowserState(browser_state) |
77 ->Start(bookmark_model.get()); | 79 ->Start(bookmark_model.get()); |
78 return bookmark_model.Pass(); | 80 return std::move(bookmark_model); |
79 } | 81 } |
80 | 82 |
81 web::BrowserState* BookmarkModelFactory::GetBrowserStateToUse( | 83 web::BrowserState* BookmarkModelFactory::GetBrowserStateToUse( |
82 web::BrowserState* context) const { | 84 web::BrowserState* context) const { |
83 return GetBrowserStateRedirectedInIncognito(context); | 85 return GetBrowserStateRedirectedInIncognito(context); |
84 } | 86 } |
85 | 87 |
86 bool BookmarkModelFactory::ServiceIsNULLWhileTesting() const { | 88 bool BookmarkModelFactory::ServiceIsNULLWhileTesting() const { |
87 return true; | 89 return true; |
88 } | 90 } |
89 | 91 |
90 } // namespace ios | 92 } // namespace ios |
OLD | NEW |