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

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

Issue 291643002: Move favicon callbacks to favicon_base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 7 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/sqlite_cursor.h" 5 #include "chrome/browser/history/android/sqlite_cursor.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_array.h" 8 #include "base/android/jni_array.h"
9 #include "base/android/jni_string.h" 9 #include "base/android/jni_string.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "chrome/browser/favicon/favicon_service.h"
12 #include "chrome/browser/history/android/android_history_types.h" 13 #include "chrome/browser/history/android/android_history_types.h"
13 #include "content/public/browser/browser_thread.h" 14 #include "content/public/browser/browser_thread.h"
14 #include "jni/SQLiteCursor_jni.h" 15 #include "jni/SQLiteCursor_jni.h"
15 #include "sql/statement.h" 16 #include "sql/statement.h"
16 17
17 using base::android::ConvertUTF8ToJavaString; 18 using base::android::ConvertUTF8ToJavaString;
18 using base::android::ScopedJavaLocalRef; 19 using base::android::ScopedJavaLocalRef;
19 using content::BrowserThread; 20 using content::BrowserThread;
20 21
21 namespace { 22 namespace {
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 image_data->assign(bitmap_data->front(), 196 image_data->assign(bitmap_data->front(),
196 bitmap_data->front() + bitmap_data->size()); 197 bitmap_data->front() + bitmap_data->size());
197 return true; 198 return true;
198 } 199 }
199 200
200 return false; 201 return false;
201 } 202 }
202 203
203 void SQLiteCursor::GetFaviconForIDInUIThread( 204 void SQLiteCursor::GetFaviconForIDInUIThread(
204 favicon_base::FaviconID id, 205 favicon_base::FaviconID id,
205 const FaviconService::FaviconRawCallback& callback) { 206 const favicon_base::FaviconRawCallback& callback) {
206 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 207 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
207 if (!tracker_.get()) 208 if (!tracker_.get())
208 tracker_.reset(new base::CancelableTaskTracker()); 209 tracker_.reset(new base::CancelableTaskTracker());
209 favicon_service_->GetLargestRawFaviconForID(id, callback, tracker_.get()); 210 favicon_service_->GetLargestRawFaviconForID(id, callback, tracker_.get());
210 } 211 }
211 212
212 void SQLiteCursor::OnFaviconData( 213 void SQLiteCursor::OnFaviconData(
213 const favicon_base::FaviconBitmapResult& bitmap_result) { 214 const favicon_base::FaviconBitmapResult& bitmap_result) {
214 favicon_bitmap_result_ = bitmap_result; 215 favicon_bitmap_result_ = bitmap_result;
215 event_.Signal(); 216 event_.Signal();
(...skipping 18 matching lines...) Expand all
234 } 235 }
235 236
236 void SQLiteCursor::RunMoveStatementOnUIThread(int pos) { 237 void SQLiteCursor::RunMoveStatementOnUIThread(int pos) {
237 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 238 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
238 if (!consumer_.get()) 239 if (!consumer_.get())
239 consumer_.reset(new CancelableRequestConsumer()); 240 consumer_.reset(new CancelableRequestConsumer());
240 service_->MoveStatement( 241 service_->MoveStatement(
241 statement_, position_, pos, consumer_.get(), 242 statement_, position_, pos, consumer_.get(),
242 base::Bind(&SQLiteCursor::OnMoved, base::Unretained(this))); 243 base::Bind(&SQLiteCursor::OnMoved, base::Unretained(this)));
243 } 244 }
OLDNEW
« no previous file with comments | « chrome/browser/history/android/sqlite_cursor.h ('k') | chrome/browser/history/android/sqlite_cursor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698