| 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/autocomplete/in_memory_url_index_factory.h" | 5 #include "ios/chrome/browser/autocomplete/in_memory_url_index_factory.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
| 10 #include "components/keyed_service/core/service_access_type.h" | 10 #include "components/keyed_service/core/service_access_type.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 // Do not force creation of the HistoryService if saving history is disabled. | 33 // Do not force creation of the HistoryService if saving history is disabled. |
| 34 std::unique_ptr<InMemoryURLIndex> in_memory_url_index(new InMemoryURLIndex( | 34 std::unique_ptr<InMemoryURLIndex> in_memory_url_index(new InMemoryURLIndex( |
| 35 ios::BookmarkModelFactory::GetForBrowserState(browser_state), | 35 ios::BookmarkModelFactory::GetForBrowserState(browser_state), |
| 36 ios::HistoryServiceFactory::GetForBrowserState( | 36 ios::HistoryServiceFactory::GetForBrowserState( |
| 37 browser_state, ServiceAccessType::IMPLICIT_ACCESS), | 37 browser_state, ServiceAccessType::IMPLICIT_ACCESS), |
| 38 ios::TemplateURLServiceFactory::GetForBrowserState(browser_state), | 38 ios::TemplateURLServiceFactory::GetForBrowserState(browser_state), |
| 39 web::WebThread::GetBlockingPool(), browser_state->GetStatePath(), | 39 web::WebThread::GetBlockingPool(), browser_state->GetStatePath(), |
| 40 schemes_to_whilelist)); | 40 schemes_to_whilelist)); |
| 41 in_memory_url_index->Init(); | 41 in_memory_url_index->Init(); |
| 42 // TODO(crbug.com/703565): remove std::move() once Xcode 9.0+ is required. |
| 42 return std::move(in_memory_url_index); | 43 return std::move(in_memory_url_index); |
| 43 } | 44 } |
| 44 | 45 |
| 45 } // namespace | 46 } // namespace |
| 46 | 47 |
| 47 // static | 48 // static |
| 48 InMemoryURLIndex* InMemoryURLIndexFactory::GetForBrowserState( | 49 InMemoryURLIndex* InMemoryURLIndexFactory::GetForBrowserState( |
| 49 ios::ChromeBrowserState* browser_state) { | 50 ios::ChromeBrowserState* browser_state) { |
| 50 return static_cast<InMemoryURLIndex*>( | 51 return static_cast<InMemoryURLIndex*>( |
| 51 GetInstance()->GetServiceForBrowserState(browser_state, true)); | 52 GetInstance()->GetServiceForBrowserState(browser_state, true)); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 81 web::BrowserState* InMemoryURLIndexFactory::GetBrowserStateToUse( | 82 web::BrowserState* InMemoryURLIndexFactory::GetBrowserStateToUse( |
| 82 web::BrowserState* context) const { | 83 web::BrowserState* context) const { |
| 83 return GetBrowserStateRedirectedInIncognito(context); | 84 return GetBrowserStateRedirectedInIncognito(context); |
| 84 } | 85 } |
| 85 | 86 |
| 86 bool InMemoryURLIndexFactory::ServiceIsNULLWhileTesting() const { | 87 bool InMemoryURLIndexFactory::ServiceIsNULLWhileTesting() const { |
| 87 return true; | 88 return true; |
| 88 } | 89 } |
| 89 | 90 |
| 90 } // namespace ios | 91 } // namespace ios |
| OLD | NEW |