OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/history_service_factory.h" | 5 #include "chrome/browser/history/history_service_factory.h" |
6 | 6 |
7 #include "base/prefs/pref_service.h" | |
8 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 7 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
9 #include "chrome/browser/history/chrome_history_client.h" | 8 #include "chrome/browser/history/chrome_history_client.h" |
10 #include "chrome/browser/profiles/incognito_helpers.h" | 9 #include "chrome/browser/profiles/incognito_helpers.h" |
11 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
12 #include "chrome/common/pref_names.h" | 11 #include "chrome/common/pref_names.h" |
13 #include "components/bookmarks/browser/bookmark_model.h" | 12 #include "components/bookmarks/browser/bookmark_model.h" |
14 #include "components/history/content/browser/content_visit_delegate.h" | 13 #include "components/history/content/browser/content_visit_delegate.h" |
15 #include "components/history/content/browser/history_database_helper.h" | 14 #include "components/history/content/browser/history_database_helper.h" |
16 #include "components/history/core/browser/history_database_params.h" | 15 #include "components/history/core/browser/history_database_params.h" |
17 #include "components/history/core/browser/history_service.h" | 16 #include "components/history/core/browser/history_service.h" |
18 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 17 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
19 #include "components/keyed_service/core/service_access_type.h" | 18 #include "components/keyed_service/core/service_access_type.h" |
| 19 #include "components/prefs/pref_service.h" |
20 | 20 |
21 // static | 21 // static |
22 history::HistoryService* HistoryServiceFactory::GetForProfile( | 22 history::HistoryService* HistoryServiceFactory::GetForProfile( |
23 Profile* profile, | 23 Profile* profile, |
24 ServiceAccessType sat) { | 24 ServiceAccessType sat) { |
25 // If saving history is disabled, only allow explicit access. | 25 // If saving history is disabled, only allow explicit access. |
26 if (sat != ServiceAccessType::EXPLICIT_ACCESS && | 26 if (sat != ServiceAccessType::EXPLICIT_ACCESS && |
27 profile->GetPrefs()->GetBoolean(prefs::kSavingBrowserHistoryDisabled)) { | 27 profile->GetPrefs()->GetBoolean(prefs::kSavingBrowserHistoryDisabled)) { |
28 return nullptr; | 28 return nullptr; |
29 } | 29 } |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 } | 91 } |
92 | 92 |
93 content::BrowserContext* HistoryServiceFactory::GetBrowserContextToUse( | 93 content::BrowserContext* HistoryServiceFactory::GetBrowserContextToUse( |
94 content::BrowserContext* context) const { | 94 content::BrowserContext* context) const { |
95 return chrome::GetBrowserContextRedirectedInIncognito(context); | 95 return chrome::GetBrowserContextRedirectedInIncognito(context); |
96 } | 96 } |
97 | 97 |
98 bool HistoryServiceFactory::ServiceIsNULLWhileTesting() const { | 98 bool HistoryServiceFactory::ServiceIsNULLWhileTesting() const { |
99 return true; | 99 return true; |
100 } | 100 } |
OLD | NEW |