| 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/history/chrome_history_client_factory.h" | 5 #include "chrome/browser/history/chrome_history_client_factory.h" |
| 6 | 6 |
| 7 #include "base/memory/singleton.h" | 7 #include "base/memory/singleton.h" |
| 8 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 8 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 9 #include "chrome/browser/history/chrome_history_client.h" | 9 #include "chrome/browser/history/chrome_history_client.h" |
| 10 #include "chrome/browser/profiles/incognito_helpers.h" | 10 #include "chrome/browser/profiles/incognito_helpers.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 BrowserContextDependencyManager::GetInstance()) { | 36 BrowserContextDependencyManager::GetInstance()) { |
| 37 DependsOn(BookmarkModelFactory::GetInstance()); | 37 DependsOn(BookmarkModelFactory::GetInstance()); |
| 38 } | 38 } |
| 39 | 39 |
| 40 ChromeHistoryClientFactory::~ChromeHistoryClientFactory() { | 40 ChromeHistoryClientFactory::~ChromeHistoryClientFactory() { |
| 41 } | 41 } |
| 42 | 42 |
| 43 KeyedService* ChromeHistoryClientFactory::BuildServiceInstanceFor( | 43 KeyedService* ChromeHistoryClientFactory::BuildServiceInstanceFor( |
| 44 content::BrowserContext* context) const { | 44 content::BrowserContext* context) const { |
| 45 Profile* profile = static_cast<Profile*>(context); | 45 Profile* profile = static_cast<Profile*>(context); |
| 46 return new ChromeHistoryClient(BookmarkModelFactory::GetForProfile(profile), | 46 return new ChromeHistoryClient(BookmarkModelFactory::GetForProfile(profile)); |
| 47 profile, | |
| 48 profile->GetTopSites()); | |
| 49 } | 47 } |
| 50 | 48 |
| 51 content::BrowserContext* ChromeHistoryClientFactory::GetBrowserContextToUse( | 49 content::BrowserContext* ChromeHistoryClientFactory::GetBrowserContextToUse( |
| 52 content::BrowserContext* context) const { | 50 content::BrowserContext* context) const { |
| 53 return chrome::GetBrowserContextRedirectedInIncognito(context); | 51 return chrome::GetBrowserContextRedirectedInIncognito(context); |
| 54 } | 52 } |
| 55 | 53 |
| 56 bool ChromeHistoryClientFactory::ServiceIsNULLWhileTesting() const { | 54 bool ChromeHistoryClientFactory::ServiceIsNULLWhileTesting() const { |
| 57 return true; | 55 return true; |
| 58 } | 56 } |
| OLD | NEW |