Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Side by Side Diff: chrome/browser/history/chrome_history_backend_client.cc

Issue 1269773002: Cleanup VersionInfo after componentization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/channel_info.h"
8 #include "components/bookmarks/browser/bookmark_model.h" 8 #include "components/bookmarks/browser/bookmark_model.h"
9 #include "components/version_info/version_info.h"
9 #include "url/gurl.h" 10 #include "url/gurl.h"
10 11
11 #if defined(OS_ANDROID) 12 #if defined(OS_ANDROID)
12 #include "base/files/file_path.h" 13 #include "base/files/file_path.h"
13 #include "base/logging.h" 14 #include "base/logging.h"
14 #include "chrome/browser/history/android/android_provider_backend.h" 15 #include "chrome/browser/history/android/android_provider_backend.h"
15 #include "components/history/core/browser/history_backend.h" 16 #include "components/history/core/browser/history_backend.h"
16 #endif 17 #endif
17 18
18 #if defined(OS_ANDROID) 19 #if defined(OS_ANDROID)
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 for (const auto& url_and_title : url_and_titles) { 58 for (const auto& url_and_title : url_and_titles) {
58 history::URLAndTitle value = { url_and_title.url, url_and_title.title }; 59 history::URLAndTitle value = { url_and_title.url, url_and_title.title };
59 bookmarks->push_back(value); 60 bookmarks->push_back(value);
60 } 61 }
61 } 62 }
62 63
63 bool ChromeHistoryBackendClient::ShouldReportDatabaseError() { 64 bool ChromeHistoryBackendClient::ShouldReportDatabaseError() {
64 // TODO(shess): For now, don't report on beta or stable so as not to 65 // 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, 66 // overwhelm the crash server. Once the big fish are fried,
66 // consider reporting at a reduced rate on the bigger channels. 67 // consider reporting at a reduced rate on the bigger channels.
67 version_info::Channel channel = chrome::VersionInfo::GetChannel(); 68 version_info::Channel channel = chrome::GetChannel();
68 return channel != version_info::Channel::STABLE && 69 return channel != version_info::Channel::STABLE &&
69 channel != version_info::Channel::BETA; 70 channel != version_info::Channel::BETA;
70 } 71 }
71 72
72 #if defined(OS_ANDROID) 73 #if defined(OS_ANDROID)
73 void ChromeHistoryBackendClient::OnHistoryBackendInitialized( 74 void ChromeHistoryBackendClient::OnHistoryBackendInitialized(
74 history::HistoryBackend* history_backend, 75 history::HistoryBackend* history_backend,
75 history::HistoryDatabase* history_database, 76 history::HistoryDatabase* history_database,
76 history::ThumbnailDatabase* thumbnail_database, 77 history::ThumbnailDatabase* thumbnail_database,
77 const base::FilePath& history_dir) { 78 const base::FilePath& history_dir) {
78 DCHECK(history_backend); 79 DCHECK(history_backend);
79 if (thumbnail_database) { 80 if (thumbnail_database) {
80 history_backend->SetUserData( 81 history_backend->SetUserData(
81 history::AndroidProviderBackend::GetUserDataKey(), 82 history::AndroidProviderBackend::GetUserDataKey(),
82 new history::AndroidProviderBackend( 83 new history::AndroidProviderBackend(
83 history_dir.Append(kAndroidCacheFilename), history_database, 84 history_dir.Append(kAndroidCacheFilename), history_database,
84 thumbnail_database, this, history_backend)); 85 thumbnail_database, this, history_backend));
85 } 86 }
86 } 87 }
87 88
88 void ChromeHistoryBackendClient::OnHistoryBackendDestroyed( 89 void ChromeHistoryBackendClient::OnHistoryBackendDestroyed(
89 history::HistoryBackend* history_backend, 90 history::HistoryBackend* history_backend,
90 const base::FilePath& history_dir) { 91 const base::FilePath& history_dir) {
91 sql::Connection::Delete(history_dir.Append(kAndroidCacheFilename)); 92 sql::Connection::Delete(history_dir.Append(kAndroidCacheFilename));
92 } 93 }
93 #endif // defined(OS_ANDROID) 94 #endif // defined(OS_ANDROID)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698