| 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 "chrome/common/chrome_version_info.h" | 7 #include "chrome/common/chrome_version_info.h" |
| 8 #include "components/bookmarks/browser/bookmark_model.h" | 8 #include "components/bookmarks/browser/bookmark_model.h" |
| 9 #include "url/gurl.h" | 9 #include "url/gurl.h" |
| 10 | 10 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 for (const auto& url_and_title : url_and_titles) { | 57 for (const auto& url_and_title : url_and_titles) { |
| 58 history::URLAndTitle value = { url_and_title.url, url_and_title.title }; | 58 history::URLAndTitle value = { url_and_title.url, url_and_title.title }; |
| 59 bookmarks->push_back(value); | 59 bookmarks->push_back(value); |
| 60 } | 60 } |
| 61 } | 61 } |
| 62 | 62 |
| 63 bool ChromeHistoryBackendClient::ShouldReportDatabaseError() { | 63 bool ChromeHistoryBackendClient::ShouldReportDatabaseError() { |
| 64 // TODO(shess): For now, don't report on beta or stable so as not to | 64 // TODO(shess): For now, don't report on beta or stable so as not to |
| 65 // overwhelm the crash server. Once the big fish are fried, | 65 // overwhelm the crash server. Once the big fish are fried, |
| 66 // consider reporting at a reduced rate on the bigger channels. | 66 // consider reporting at a reduced rate on the bigger channels. |
| 67 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); | 67 version_info::Channel channel = chrome::VersionInfo::GetChannel(); |
| 68 return channel != chrome::VersionInfo::CHANNEL_STABLE && | 68 return channel != version_info::Channel::STABLE && |
| 69 channel != chrome::VersionInfo::CHANNEL_BETA; | 69 channel != version_info::Channel::BETA; |
| 70 } | 70 } |
| 71 | 71 |
| 72 #if defined(OS_ANDROID) | 72 #if defined(OS_ANDROID) |
| 73 void ChromeHistoryBackendClient::OnHistoryBackendInitialized( | 73 void ChromeHistoryBackendClient::OnHistoryBackendInitialized( |
| 74 history::HistoryBackend* history_backend, | 74 history::HistoryBackend* history_backend, |
| 75 history::HistoryDatabase* history_database, | 75 history::HistoryDatabase* history_database, |
| 76 history::ThumbnailDatabase* thumbnail_database, | 76 history::ThumbnailDatabase* thumbnail_database, |
| 77 const base::FilePath& history_dir) { | 77 const base::FilePath& history_dir) { |
| 78 DCHECK(history_backend); | 78 DCHECK(history_backend); |
| 79 if (thumbnail_database) { | 79 if (thumbnail_database) { |
| 80 history_backend->SetUserData( | 80 history_backend->SetUserData( |
| 81 history::AndroidProviderBackend::GetUserDataKey(), | 81 history::AndroidProviderBackend::GetUserDataKey(), |
| 82 new history::AndroidProviderBackend( | 82 new history::AndroidProviderBackend( |
| 83 history_dir.Append(kAndroidCacheFilename), history_database, | 83 history_dir.Append(kAndroidCacheFilename), history_database, |
| 84 thumbnail_database, this, history_backend)); | 84 thumbnail_database, this, history_backend)); |
| 85 } | 85 } |
| 86 } | 86 } |
| 87 | 87 |
| 88 void ChromeHistoryBackendClient::OnHistoryBackendDestroyed( | 88 void ChromeHistoryBackendClient::OnHistoryBackendDestroyed( |
| 89 history::HistoryBackend* history_backend, | 89 history::HistoryBackend* history_backend, |
| 90 const base::FilePath& history_dir) { | 90 const base::FilePath& history_dir) { |
| 91 sql::Connection::Delete(history_dir.Append(kAndroidCacheFilename)); | 91 sql::Connection::Delete(history_dir.Append(kAndroidCacheFilename)); |
| 92 } | 92 } |
| 93 #endif // defined(OS_ANDROID) | 93 #endif // defined(OS_ANDROID) |
| OLD | NEW |