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 "chrome/browser/history/chrome_history_backend_client.h" | 5 #include "chrome/browser/history/chrome_history_backend_client.h" |
6 | 6 |
| 7 #include "base/memory/ptr_util.h" |
7 #include "build/build_config.h" | 8 #include "build/build_config.h" |
8 #include "chrome/common/channel_info.h" | 9 #include "chrome/common/channel_info.h" |
9 #include "components/bookmarks/browser/bookmark_model.h" | 10 #include "components/bookmarks/browser/bookmark_model.h" |
10 #include "components/version_info/version_info.h" | 11 #include "components/version_info/version_info.h" |
11 #include "content/public/browser/child_process_security_policy.h" | 12 #include "content/public/browser/child_process_security_policy.h" |
12 #include "url/gurl.h" | 13 #include "url/gurl.h" |
13 | 14 |
14 #if defined(OS_ANDROID) | 15 #if defined(OS_ANDROID) |
15 #include "base/files/file_path.h" | 16 #include "base/files/file_path.h" |
16 #include "base/logging.h" | 17 #include "base/logging.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 #if defined(OS_ANDROID) | 81 #if defined(OS_ANDROID) |
81 void ChromeHistoryBackendClient::OnHistoryBackendInitialized( | 82 void ChromeHistoryBackendClient::OnHistoryBackendInitialized( |
82 history::HistoryBackend* history_backend, | 83 history::HistoryBackend* history_backend, |
83 history::HistoryDatabase* history_database, | 84 history::HistoryDatabase* history_database, |
84 history::ThumbnailDatabase* thumbnail_database, | 85 history::ThumbnailDatabase* thumbnail_database, |
85 const base::FilePath& history_dir) { | 86 const base::FilePath& history_dir) { |
86 DCHECK(history_backend); | 87 DCHECK(history_backend); |
87 if (thumbnail_database) { | 88 if (thumbnail_database) { |
88 history_backend->SetUserData( | 89 history_backend->SetUserData( |
89 history::AndroidProviderBackend::GetUserDataKey(), | 90 history::AndroidProviderBackend::GetUserDataKey(), |
90 new history::AndroidProviderBackend( | 91 base::MakeUnique<history::AndroidProviderBackend>( |
91 history_dir.Append(kAndroidCacheFilename), history_database, | 92 history_dir.Append(kAndroidCacheFilename), history_database, |
92 thumbnail_database, this, history_backend)); | 93 thumbnail_database, this, history_backend)); |
93 } | 94 } |
94 } | 95 } |
95 | 96 |
96 void ChromeHistoryBackendClient::OnHistoryBackendDestroyed( | 97 void ChromeHistoryBackendClient::OnHistoryBackendDestroyed( |
97 history::HistoryBackend* history_backend, | 98 history::HistoryBackend* history_backend, |
98 const base::FilePath& history_dir) { | 99 const base::FilePath& history_dir) { |
99 sql::Connection::Delete(history_dir.Append(kAndroidCacheFilename)); | 100 sql::Connection::Delete(history_dir.Append(kAndroidCacheFilename)); |
100 } | 101 } |
101 #endif // defined(OS_ANDROID) | 102 #endif // defined(OS_ANDROID) |
OLD | NEW |