| 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 "chrome/browser/autocomplete/chrome_autocomplete_provider_client.h" | 5 #include "chrome/browser/autocomplete/chrome_autocomplete_provider_client.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 return HistoryServiceFactory::GetForProfile( | 92 return HistoryServiceFactory::GetForProfile( |
| 93 profile_, ServiceAccessType::EXPLICIT_ACCESS); | 93 profile_, ServiceAccessType::EXPLICIT_ACCESS); |
| 94 } | 94 } |
| 95 | 95 |
| 96 scoped_refptr<history::TopSites> | 96 scoped_refptr<history::TopSites> |
| 97 ChromeAutocompleteProviderClient::GetTopSites() { | 97 ChromeAutocompleteProviderClient::GetTopSites() { |
| 98 return TopSitesFactory::GetForProfile(profile_); | 98 return TopSitesFactory::GetForProfile(profile_); |
| 99 } | 99 } |
| 100 | 100 |
| 101 bookmarks::BookmarkModel* ChromeAutocompleteProviderClient::GetBookmarkModel() { | 101 bookmarks::BookmarkModel* ChromeAutocompleteProviderClient::GetBookmarkModel() { |
| 102 return BookmarkModelFactory::GetForProfile(profile_); | 102 return BookmarkModelFactory::GetForBrowserContext(profile_); |
| 103 } | 103 } |
| 104 | 104 |
| 105 history::URLDatabase* ChromeAutocompleteProviderClient::GetInMemoryDatabase() { | 105 history::URLDatabase* ChromeAutocompleteProviderClient::GetInMemoryDatabase() { |
| 106 history::HistoryService* history_service = GetHistoryService(); | 106 history::HistoryService* history_service = GetHistoryService(); |
| 107 | 107 |
| 108 // This method is called in unit test contexts where the HistoryService isn't | 108 // This method is called in unit test contexts where the HistoryService isn't |
| 109 // loaded. | 109 // loaded. |
| 110 return history_service ? history_service->InMemoryDatabase() : NULL; | 110 return history_service ? history_service->InMemoryDatabase() : NULL; |
| 111 } | 111 } |
| 112 | 112 |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 image_service->Prefetch(url); | 236 image_service->Prefetch(url); |
| 237 } | 237 } |
| 238 | 238 |
| 239 void ChromeAutocompleteProviderClient::OnAutocompleteControllerResultReady( | 239 void ChromeAutocompleteProviderClient::OnAutocompleteControllerResultReady( |
| 240 AutocompleteController* controller) { | 240 AutocompleteController* controller) { |
| 241 content::NotificationService::current()->Notify( | 241 content::NotificationService::current()->Notify( |
| 242 chrome::NOTIFICATION_AUTOCOMPLETE_CONTROLLER_RESULT_READY, | 242 chrome::NOTIFICATION_AUTOCOMPLETE_CONTROLLER_RESULT_READY, |
| 243 content::Source<AutocompleteController>(controller), | 243 content::Source<AutocompleteController>(controller), |
| 244 content::NotificationService::NoDetails()); | 244 content::NotificationService::NoDetails()); |
| 245 } | 245 } |
| OLD | NEW |