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/history_backend.h" | 5 #include "chrome/browser/history/history_backend.h" |
6 | 6 |
7 #include "chrome/browser/history/android/android_provider_backend.h" | 7 #include "chrome/browser/history/android/android_provider_backend.h" |
8 | 8 |
9 namespace history { | 9 namespace history { |
10 | 10 |
11 void HistoryBackend::InsertHistoryAndBookmark( | 11 AndroidURLID HistoryBackend::InsertHistoryAndBookmark( |
12 scoped_refptr<InsertRequest> request, | |
13 const HistoryAndBookmarkRow& row) { | 12 const HistoryAndBookmarkRow& row) { |
14 if (request->canceled()) | |
15 return; | |
16 | |
17 AndroidURLID id = 0; | 13 AndroidURLID id = 0; |
18 if (android_provider_backend_) | 14 if (android_provider_backend_) |
19 id = android_provider_backend_->InsertHistoryAndBookmark(row); | 15 id = android_provider_backend_->InsertHistoryAndBookmark(row); |
20 | 16 return id; |
21 request->ForwardResult(request->handle(), id != 0, id); | |
22 } | 17 } |
23 | 18 |
24 AndroidStatement* HistoryBackend::QueryHistoryAndBookmarks( | 19 AndroidStatement* HistoryBackend::QueryHistoryAndBookmarks( |
25 const std::vector<HistoryAndBookmarkRow::ColumnID>& projections, | 20 const std::vector<HistoryAndBookmarkRow::ColumnID>& projections, |
26 const std::string& selection, | 21 const std::string& selection, |
27 const std::vector<base::string16>& selection_args, | 22 const std::vector<base::string16>& selection_args, |
28 const std::string& sort_order) { | 23 const std::string& sort_order) { |
29 AndroidStatement* statement = NULL; | 24 AndroidStatement* statement = NULL; |
30 if (android_provider_backend_) { | 25 if (android_provider_backend_) { |
31 statement = android_provider_backend_->QueryHistoryAndBookmarks( | 26 statement = android_provider_backend_->QueryHistoryAndBookmarks( |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 | 99 |
105 return cur; | 100 return cur; |
106 } | 101 } |
107 | 102 |
108 void HistoryBackend::CloseStatement(AndroidStatement* statement) { | 103 void HistoryBackend::CloseStatement(AndroidStatement* statement) { |
109 delete statement; | 104 delete statement; |
110 } | 105 } |
111 | 106 |
112 // Search Term ----------------------------------------------------------------- | 107 // Search Term ----------------------------------------------------------------- |
113 | 108 |
114 void HistoryBackend::InsertSearchTerm(scoped_refptr<InsertRequest> request, | 109 SearchTermID HistoryBackend::InsertSearchTerm(const SearchRow& row) { |
115 const SearchRow& row) { | |
116 if (request->canceled()) | |
117 return; | |
118 | |
119 SearchTermID id = 0; | 110 SearchTermID id = 0; |
120 if (android_provider_backend_) | 111 if (android_provider_backend_) |
121 id = android_provider_backend_->InsertSearchTerm(row); | 112 id = android_provider_backend_->InsertSearchTerm(row); |
122 | 113 return id; |
123 request->ForwardResult(request->handle(), id != 0, id); | |
124 } | 114 } |
125 | 115 |
126 void HistoryBackend::UpdateSearchTerms( | 116 void HistoryBackend::UpdateSearchTerms( |
127 scoped_refptr<UpdateRequest> request, | 117 scoped_refptr<UpdateRequest> request, |
128 const SearchRow& row, | 118 const SearchRow& row, |
129 const std::string& selection, | 119 const std::string& selection, |
130 const std::vector<base::string16> selection_args) { | 120 const std::vector<base::string16> selection_args) { |
131 if (request->canceled()) | 121 if (request->canceled()) |
132 return; | 122 return; |
133 | 123 |
(...skipping 30 matching lines...) Expand all Loading... |
164 const std::string& sort_order) { | 154 const std::string& sort_order) { |
165 AndroidStatement* statement = NULL; | 155 AndroidStatement* statement = NULL; |
166 if (android_provider_backend_) { | 156 if (android_provider_backend_) { |
167 statement = android_provider_backend_->QuerySearchTerms(projections, | 157 statement = android_provider_backend_->QuerySearchTerms(projections, |
168 selection, selection_args, sort_order); | 158 selection, selection_args, sort_order); |
169 } | 159 } |
170 return statement; | 160 return statement; |
171 } | 161 } |
172 | 162 |
173 } // namespace history | 163 } // namespace history |
OLD | NEW |