Chromium Code Reviews| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 73 virtual void SetInMemoryBackend( | 73 virtual void SetInMemoryBackend( |
| 74 scoped_ptr<InMemoryHistoryBackend> backend) override {} | 74 scoped_ptr<InMemoryHistoryBackend> backend) override {} |
| 75 virtual void NotifyAddVisit(const history::BriefVisitInfo& info) override {} | 75 virtual void NotifyAddVisit(const history::BriefVisitInfo& info) override {} |
| 76 virtual void NotifyFaviconChanged(const std::set<GURL>& url) override { | 76 virtual void NotifyFaviconChanged(const std::set<GURL>& url) override { |
| 77 favicon_changed_.reset(new std::set<GURL>(url.begin(), url.end())); | 77 favicon_changed_.reset(new std::set<GURL>(url.begin(), url.end())); |
| 78 } | 78 } |
| 79 virtual void NotifyURLVisited(ui::PageTransition, | 79 virtual void NotifyURLVisited(ui::PageTransition, |
| 80 const history::URLRow& row, | 80 const history::URLRow& row, |
| 81 const history::RedirectList& redirects, | 81 const history::RedirectList& redirects, |
| 82 base::Time visit_time) override {} | 82 base::Time visit_time) override {} |
| 83 virtual void NotifyURLsModified(const history::URLRows& rows) override { | |
|
droger
2014/11/12 17:56:59
Nit: remove virtual.
sdefresne
2014/11/13 09:12:01
Done.
| |
| 84 modified_details_.reset(new history::URLRows(rows)); | |
| 85 } | |
| 83 virtual void BroadcastNotifications( | 86 virtual void BroadcastNotifications( |
| 84 int type, | 87 int type, |
| 85 scoped_ptr<HistoryDetails> details) override { | 88 scoped_ptr<HistoryDetails> details) override { |
| 86 switch (type) { | 89 DCHECK(type == chrome::NOTIFICATION_HISTORY_URLS_DELETED); |
| 87 case chrome::NOTIFICATION_HISTORY_URLS_DELETED: { | 90 scoped_ptr<URLsDeletedDetails> urls_deleted_details( |
| 88 scoped_ptr<URLsDeletedDetails> urls_deleted_details( | 91 static_cast<URLsDeletedDetails*>(details.release())); |
| 89 static_cast<URLsDeletedDetails*>(details.release())); | 92 deleted_details_.reset(new history::URLRows(urls_deleted_details->rows)); |
| 90 deleted_details_.reset(new history::URLRows( | |
| 91 urls_deleted_details->rows)); | |
| 92 break; | |
| 93 } | |
| 94 case chrome::NOTIFICATION_HISTORY_URLS_MODIFIED: { | |
| 95 scoped_ptr<URLsModifiedDetails> urls_modified_details( | |
| 96 static_cast<URLsModifiedDetails*>(details.release())); | |
| 97 modified_details_.reset(new history::URLRows( | |
| 98 urls_modified_details->changed_urls)); | |
| 99 break; | |
| 100 } | |
| 101 } | |
| 102 } | 93 } |
| 103 virtual void DBLoaded() override {} | 94 virtual void DBLoaded() override {} |
| 104 | 95 |
| 105 history::URLRows* deleted_details() const { return deleted_details_.get(); } | 96 history::URLRows* deleted_details() const { return deleted_details_.get(); } |
| 106 | 97 |
| 107 history::URLRows* modified_details() const { return modified_details_.get(); } | 98 history::URLRows* modified_details() const { return modified_details_.get(); } |
| 108 | 99 |
| 109 std::set<GURL>* favicon_changed() const { return favicon_changed_.get(); } | 100 std::set<GURL>* favicon_changed() const { return favicon_changed_.get(); } |
| 110 | 101 |
| 111 void ResetDetails() { | 102 void ResetDetails() { |
| (...skipping 2039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2151 update_args, &update_count)); | 2142 update_args, &update_count)); |
| 2152 // Verify notifications. | 2143 // Verify notifications. |
| 2153 EXPECT_FALSE(notifier_.deleted_details()); | 2144 EXPECT_FALSE(notifier_.deleted_details()); |
| 2154 ASSERT_TRUE(notifier_.modified_details()); | 2145 ASSERT_TRUE(notifier_.modified_details()); |
| 2155 ASSERT_EQ(1u, notifier_.modified_details()->size()); | 2146 ASSERT_EQ(1u, notifier_.modified_details()->size()); |
| 2156 // No favicon will be updated as thumbnail database is missing. | 2147 // No favicon will be updated as thumbnail database is missing. |
| 2157 EXPECT_FALSE(notifier_.favicon_changed()); | 2148 EXPECT_FALSE(notifier_.favicon_changed()); |
| 2158 } | 2149 } |
| 2159 | 2150 |
| 2160 } // namespace history | 2151 } // namespace history |
| OLD | NEW |