| 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/android/android_provider_backend.h" | 5 #include "chrome/browser/history/android/android_provider_backend.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 | 69 |
| 70 } // namespace | 70 } // namespace |
| 71 | 71 |
| 72 class AndroidProviderBackendDelegate : public HistoryBackend::Delegate { | 72 class AndroidProviderBackendDelegate : public HistoryBackend::Delegate { |
| 73 public: | 73 public: |
| 74 AndroidProviderBackendDelegate() {} | 74 AndroidProviderBackendDelegate() {} |
| 75 | 75 |
| 76 void NotifyProfileError(sql::InitStatus init_status) override {} | 76 void NotifyProfileError(sql::InitStatus init_status) override {} |
| 77 void SetInMemoryBackend( | 77 void SetInMemoryBackend( |
| 78 scoped_ptr<InMemoryHistoryBackend> backend) override {} | 78 scoped_ptr<InMemoryHistoryBackend> backend) override {} |
| 79 void NotifyFaviconChanged(const std::set<GURL>& url) override { | 79 void NotifyFaviconsChanged(const std::set<GURL>& page_urls, |
| 80 favicon_changed_.reset(new std::set<GURL>(url.begin(), url.end())); | 80 const GURL& icon_url) override { |
| 81 favicon_changed_.reset( |
| 82 new std::set<GURL>(page_urls.begin(), page_urls.end())); |
| 81 } | 83 } |
| 82 void NotifyURLVisited(ui::PageTransition, | 84 void NotifyURLVisited(ui::PageTransition, |
| 83 const history::URLRow& row, | 85 const history::URLRow& row, |
| 84 const history::RedirectList& redirects, | 86 const history::RedirectList& redirects, |
| 85 base::Time visit_time) override {} | 87 base::Time visit_time) override {} |
| 86 void NotifyURLsModified(const history::URLRows& rows) override { | 88 void NotifyURLsModified(const history::URLRows& rows) override { |
| 87 modified_details_.reset(new history::URLRows(rows)); | 89 modified_details_.reset(new history::URLRows(rows)); |
| 88 } | 90 } |
| 89 void NotifyURLsDeleted(bool all_history, | 91 void NotifyURLsDeleted(bool all_history, |
| 90 bool expired, | 92 bool expired, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 116 scoped_ptr<std::set<GURL>> favicon_changed_; | 118 scoped_ptr<std::set<GURL>> favicon_changed_; |
| 117 | 119 |
| 118 DISALLOW_COPY_AND_ASSIGN(AndroidProviderBackendDelegate); | 120 DISALLOW_COPY_AND_ASSIGN(AndroidProviderBackendDelegate); |
| 119 }; | 121 }; |
| 120 | 122 |
| 121 class AndroidProviderBackendNotifier : public HistoryBackendNotifier { | 123 class AndroidProviderBackendNotifier : public HistoryBackendNotifier { |
| 122 public: | 124 public: |
| 123 AndroidProviderBackendNotifier() {} | 125 AndroidProviderBackendNotifier() {} |
| 124 | 126 |
| 125 // HistoryBackendNotifier: | 127 // HistoryBackendNotifier: |
| 126 void NotifyFaviconChanged(const std::set<GURL>& url) override { | 128 void NotifyFaviconsChanged(const std::set<GURL>& page_urls, |
| 127 favicon_changed_.reset(new std::set<GURL>(url.begin(), url.end())); | 129 const GURL& icon_url) override { |
| 130 favicon_changed_.reset( |
| 131 new std::set<GURL>(page_urls.begin(), page_urls.end())); |
| 128 } | 132 } |
| 129 void NotifyURLVisited(ui::PageTransition, | 133 void NotifyURLVisited(ui::PageTransition, |
| 130 const history::URLRow& row, | 134 const history::URLRow& row, |
| 131 const history::RedirectList& redirects, | 135 const history::RedirectList& redirects, |
| 132 base::Time visit_time) override {} | 136 base::Time visit_time) override {} |
| 133 void NotifyURLsModified(const history::URLRows& rows) override { | 137 void NotifyURLsModified(const history::URLRows& rows) override { |
| 134 modified_details_.reset(new history::URLRows(rows)); | 138 modified_details_.reset(new history::URLRows(rows)); |
| 135 } | 139 } |
| 136 void NotifyURLsDeleted(bool all_history, | 140 void NotifyURLsDeleted(bool all_history, |
| 137 bool expired, | 141 bool expired, |
| (...skipping 2013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2151 update_args, &update_count)); | 2155 update_args, &update_count)); |
| 2152 // Verify notifications. | 2156 // Verify notifications. |
| 2153 EXPECT_FALSE(notifier_.deleted_details()); | 2157 EXPECT_FALSE(notifier_.deleted_details()); |
| 2154 ASSERT_TRUE(notifier_.modified_details()); | 2158 ASSERT_TRUE(notifier_.modified_details()); |
| 2155 ASSERT_EQ(1u, notifier_.modified_details()->size()); | 2159 ASSERT_EQ(1u, notifier_.modified_details()->size()); |
| 2156 // No favicon will be updated as thumbnail database is missing. | 2160 // No favicon will be updated as thumbnail database is missing. |
| 2157 EXPECT_FALSE(notifier_.favicon_changed()); | 2161 EXPECT_FALSE(notifier_.favicon_changed()); |
| 2158 } | 2162 } |
| 2159 | 2163 |
| 2160 } // namespace history | 2164 } // namespace history |
| OLD | NEW |