| 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> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 new bookmarks::BookmarkModel( | 66 new bookmarks::BookmarkModel( |
| 67 base::MakeUnique<BookmarkClientImpl>(browser_state))); | 67 base::MakeUnique<BookmarkClientImpl>(browser_state))); |
| 68 bookmark_model->Load( | 68 bookmark_model->Load( |
| 69 browser_state->GetPrefs(), | 69 browser_state->GetPrefs(), |
| 70 browser_state->GetStatePath(), | 70 browser_state->GetStatePath(), |
| 71 ios::StartupTaskRunnerServiceFactory::GetForBrowserState(browser_state) | 71 ios::StartupTaskRunnerServiceFactory::GetForBrowserState(browser_state) |
| 72 ->GetBookmarkTaskRunner(), | 72 ->GetBookmarkTaskRunner(), |
| 73 web::WebThread::GetTaskRunnerForThread(web::WebThread::UI)); | 73 web::WebThread::GetTaskRunnerForThread(web::WebThread::UI)); |
| 74 ios::BookmarkUndoServiceFactory::GetForBrowserState(browser_state) | 74 ios::BookmarkUndoServiceFactory::GetForBrowserState(browser_state) |
| 75 ->Start(bookmark_model.get()); | 75 ->Start(bookmark_model.get()); |
| 76 // TODO(crbug.com/703565): remove std::move() once Xcode 9.0+ is required. |
| 76 return std::move(bookmark_model); | 77 return std::move(bookmark_model); |
| 77 } | 78 } |
| 78 | 79 |
| 79 web::BrowserState* BookmarkModelFactory::GetBrowserStateToUse( | 80 web::BrowserState* BookmarkModelFactory::GetBrowserStateToUse( |
| 80 web::BrowserState* context) const { | 81 web::BrowserState* context) const { |
| 81 return GetBrowserStateRedirectedInIncognito(context); | 82 return GetBrowserStateRedirectedInIncognito(context); |
| 82 } | 83 } |
| 83 | 84 |
| 84 bool BookmarkModelFactory::ServiceIsNULLWhileTesting() const { | 85 bool BookmarkModelFactory::ServiceIsNULLWhileTesting() const { |
| 85 return true; | 86 return true; |
| 86 } | 87 } |
| 87 | 88 |
| 88 } // namespace ios | 89 } // namespace ios |
| OLD | NEW |