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.h" | 5 #include "chrome/browser/history/chrome_history_client.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/history/history_utils.h" |
8 #include "chrome/browser/ui/profile_error_dialog.h" | 9 #include "chrome/browser/ui/profile_error_dialog.h" |
9 #include "chrome/common/chrome_version_info.h" | 10 #include "chrome/common/chrome_version_info.h" |
10 #include "chrome/grit/chromium_strings.h" | 11 #include "chrome/grit/chromium_strings.h" |
11 #include "chrome/grit/generated_resources.h" | 12 #include "chrome/grit/generated_resources.h" |
12 #include "components/bookmarks/browser/bookmark_model.h" | 13 #include "components/bookmarks/browser/bookmark_model.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 "chrome/browser/history/android/android_provider_backend.h" | 17 #include "chrome/browser/history/android/android_provider_backend.h" |
17 #include "chrome/browser/history/history_backend.h" | 18 #include "chrome/browser/history/history_backend.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 bookmarks->reserve(bookmarks->size() + bookmarks_url_and_title.size()); | 56 bookmarks->reserve(bookmarks->size() + bookmarks_url_and_title.size()); |
56 for (size_t i = 0; i < bookmarks_url_and_title.size(); ++i) { | 57 for (size_t i = 0; i < bookmarks_url_and_title.size(); ++i) { |
57 history::URLAndTitle value = { | 58 history::URLAndTitle value = { |
58 bookmarks_url_and_title[i].url, | 59 bookmarks_url_and_title[i].url, |
59 bookmarks_url_and_title[i].title, | 60 bookmarks_url_and_title[i].title, |
60 }; | 61 }; |
61 bookmarks->push_back(value); | 62 bookmarks->push_back(value); |
62 } | 63 } |
63 } | 64 } |
64 | 65 |
| 66 bool ChromeHistoryClient::CanAddURL(const GURL& url) { |
| 67 return CanAddURLToHistory(url); |
| 68 } |
| 69 |
65 void ChromeHistoryClient::NotifyProfileError(sql::InitStatus init_status) { | 70 void ChromeHistoryClient::NotifyProfileError(sql::InitStatus init_status) { |
66 ShowProfileErrorDialog( | 71 ShowProfileErrorDialog( |
67 PROFILE_ERROR_HISTORY, | 72 PROFILE_ERROR_HISTORY, |
68 (init_status == sql::INIT_FAILURE) ? | 73 (init_status == sql::INIT_FAILURE) ? |
69 IDS_COULDNT_OPEN_PROFILE_ERROR : IDS_PROFILE_TOO_NEW_ERROR); | 74 IDS_COULDNT_OPEN_PROFILE_ERROR : IDS_PROFILE_TOO_NEW_ERROR); |
70 } | 75 } |
71 | 76 |
72 bool ChromeHistoryClient::ShouldReportDatabaseError() { | 77 bool ChromeHistoryClient::ShouldReportDatabaseError() { |
73 // TODO(shess): For now, don't report on beta or stable so as not to | 78 // TODO(shess): For now, don't report on beta or stable so as not to |
74 // overwhelm the crash server. Once the big fish are fried, | 79 // overwhelm the crash server. Once the big fish are fried, |
(...skipping 29 matching lines...) Expand all Loading... |
104 thumbnail_database, this, history_backend)); | 109 thumbnail_database, this, history_backend)); |
105 } | 110 } |
106 } | 111 } |
107 | 112 |
108 void ChromeHistoryClient::OnHistoryBackendDestroyed( | 113 void ChromeHistoryClient::OnHistoryBackendDestroyed( |
109 history::HistoryBackend* history_backend, | 114 history::HistoryBackend* history_backend, |
110 const base::FilePath& history_dir) { | 115 const base::FilePath& history_dir) { |
111 sql::Connection::Delete(GetAndroidCacheFileName(history_dir)); | 116 sql::Connection::Delete(GetAndroidCacheFileName(history_dir)); |
112 } | 117 } |
113 #endif | 118 #endif |
OLD | NEW |