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

Side by Side Diff: chrome/browser/history/android/android_provider_backend_unittest.cc

Issue 642623004: Rename VisitDatabaseObserver to HistoryServiceObserver (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@373326
Patch Set: Address comments & rebase Created 6 years, 2 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
« no previous file with comments | « no previous file | chrome/browser/history/history_backend.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 65
66 } // namespace 66 } // namespace
67 67
68 class AndroidProviderBackendDelegate : public HistoryBackend::Delegate { 68 class AndroidProviderBackendDelegate : public HistoryBackend::Delegate {
69 public: 69 public:
70 AndroidProviderBackendDelegate() {} 70 AndroidProviderBackendDelegate() {}
71 71
72 virtual void NotifyProfileError(sql::InitStatus init_status) override {} 72 virtual void NotifyProfileError(sql::InitStatus init_status) override {}
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 NotifyFaviconChanged(const std::set<GURL>& url) override { 76 virtual void NotifyFaviconChanged(const std::set<GURL>& url) override {
76 favicon_changed_.reset(new std::set<GURL>(url.begin(), url.end())); 77 favicon_changed_.reset(new std::set<GURL>(url.begin(), url.end()));
77 } 78 }
78 virtual void BroadcastNotifications( 79 virtual void BroadcastNotifications(
79 int type, 80 int type,
80 scoped_ptr<HistoryDetails> details) override { 81 scoped_ptr<HistoryDetails> details) override {
81 switch (type) { 82 switch (type) {
82 case chrome::NOTIFICATION_HISTORY_URLS_DELETED: 83 case chrome::NOTIFICATION_HISTORY_URLS_DELETED:
83 deleted_details_.reset( 84 deleted_details_.reset(
84 static_cast<URLsDeletedDetails*>(details.release())); 85 static_cast<URLsDeletedDetails*>(details.release()));
85 break; 86 break;
86 case chrome::NOTIFICATION_HISTORY_URLS_MODIFIED: 87 case chrome::NOTIFICATION_HISTORY_URLS_MODIFIED:
87 modified_details_.reset( 88 modified_details_.reset(
88 static_cast<URLsModifiedDetails*>(details.release())); 89 static_cast<URLsModifiedDetails*>(details.release()));
89 break; 90 break;
90 } 91 }
91 } 92 }
92 virtual void DBLoaded() override {} 93 virtual void DBLoaded() override {}
93 virtual void NotifyVisitDBObserversOnAddVisit(
94 const history::BriefVisitInfo& info) override {}
95 94
96 URLsDeletedDetails* deleted_details() const { 95 URLsDeletedDetails* deleted_details() const {
97 return deleted_details_.get(); 96 return deleted_details_.get();
98 } 97 }
99 98
100 URLsModifiedDetails* modified_details() const { 99 URLsModifiedDetails* modified_details() const {
101 return modified_details_.get(); 100 return modified_details_.get();
102 } 101 }
103 102
104 std::set<GURL>* favicon_changed() const { return favicon_changed_.get(); } 103 std::set<GURL>* favicon_changed() const { return favicon_changed_.get(); }
(...skipping 1999 matching lines...) Expand 10 before | Expand all | Expand 10 after
2104 update_args, &update_count)); 2103 update_args, &update_count));
2105 // Verify notifications. 2104 // Verify notifications.
2106 EXPECT_FALSE(delegate_.deleted_details()); 2105 EXPECT_FALSE(delegate_.deleted_details());
2107 ASSERT_TRUE(delegate_.modified_details()); 2106 ASSERT_TRUE(delegate_.modified_details());
2108 ASSERT_EQ(1u, delegate_.modified_details()->changed_urls.size()); 2107 ASSERT_EQ(1u, delegate_.modified_details()->changed_urls.size());
2109 // No favicon will be updated as thumbnail database is missing. 2108 // No favicon will be updated as thumbnail database is missing.
2110 EXPECT_FALSE(delegate_.favicon_changed()); 2109 EXPECT_FALSE(delegate_.favicon_changed());
2111 } 2110 }
2112 2111
2113 } // namespace history 2112 } // namespace history
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/history/history_backend.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698