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

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

Issue 562603002: Move PageTransition from //content/public/common to //ui/base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 3 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 (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/visit_sql_handler.h" 5 #include "chrome/browser/history/android/visit_sql_handler.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/history/history_database.h" 8 #include "chrome/browser/history/history_database.h"
9 9
10 using base::Time; 10 using base::Time;
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 106
107 bool VisitSQLHandler::Delete(const TableIDRows& ids_set) { 107 bool VisitSQLHandler::Delete(const TableIDRows& ids_set) {
108 for (TableIDRows::const_iterator ids = ids_set.begin(); 108 for (TableIDRows::const_iterator ids = ids_set.begin();
109 ids != ids_set.end(); ++ids) { 109 ids != ids_set.end(); ++ids) {
110 DeleteVisitsForURL(ids->url_id); 110 DeleteVisitsForURL(ids->url_id);
111 } 111 }
112 return true; 112 return true;
113 } 113 }
114 114
115 bool VisitSQLHandler::AddVisit(URLID url_id, const Time& visit_time) { 115 bool VisitSQLHandler::AddVisit(URLID url_id, const Time& visit_time) {
116 // TODO : Is 'content::PAGE_TRANSITION_AUTO_BOOKMARK' proper? 116 // TODO : Is 'ui::PAGE_TRANSITION_AUTO_BOOKMARK' proper?
117 // if not, a new content::PageTransition type will need. 117 // if not, a new ui::PageTransition type will need.
118 VisitRow visit_row(url_id, visit_time, 0, 118 VisitRow visit_row(url_id, visit_time, 0,
119 content::PAGE_TRANSITION_AUTO_BOOKMARK, 0); 119 ui::PAGE_TRANSITION_AUTO_BOOKMARK, 0);
120 return history_db_->AddVisit(&visit_row, SOURCE_BROWSED); 120 return history_db_->AddVisit(&visit_row, SOURCE_BROWSED);
121 } 121 }
122 122
123 bool VisitSQLHandler::AddVisitRows(URLID url_id, 123 bool VisitSQLHandler::AddVisitRows(URLID url_id,
124 int visit_count, 124 int visit_count,
125 const Time& last_visit_time) { 125 const Time& last_visit_time) {
126 int64 last_update_value = last_visit_time.ToInternalValue(); 126 int64 last_update_value = last_visit_time.ToInternalValue();
127 for (int i = 0; i < visit_count; i++) { 127 for (int i = 0; i < visit_count; i++) {
128 if (!AddVisit(url_id, Time::FromInternalValue(last_update_value - i))) 128 if (!AddVisit(url_id, Time::FromInternalValue(last_update_value - i)))
129 return false; 129 return false;
130 } 130 }
131 return true; 131 return true;
132 } 132 }
133 133
134 bool VisitSQLHandler::DeleteVisitsForURL(URLID url_id) { 134 bool VisitSQLHandler::DeleteVisitsForURL(URLID url_id) {
135 VisitVector visits; 135 VisitVector visits;
136 if (!history_db_->GetVisitsForURL(url_id, &visits)) 136 if (!history_db_->GetVisitsForURL(url_id, &visits))
137 return false; 137 return false;
138 138
139 for (VisitVector::const_iterator v = visits.begin(); v != visits.end(); ++v) { 139 for (VisitVector::const_iterator v = visits.begin(); v != visits.end(); ++v) {
140 history_db_->DeleteVisit(*v); 140 history_db_->DeleteVisit(*v);
141 } 141 }
142 return true; 142 return true;
143 } 143 }
144 144
145 } // namespace history. 145 } // namespace history.
OLDNEW
« no previous file with comments | « chrome/browser/history/android/android_provider_backend_unittest.cc ('k') | chrome/browser/history/expire_history_backend.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698