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

Side by Side Diff: content/browser/web_contents/web_contents_android.cc

Issue 1624583003: Reload Lo-Fi images inline instead of reloading the whole page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added comment Created 4 years, 10 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/browser/web_contents/web_contents_android.h" 5 #include "content/browser/web_contents/web_contents_android.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/android/jni_array.h" 10 #include "base/android/jni_array.h"
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 gfx::Rect(x, y, width, height), 675 gfx::Rect(x, y, width, height),
676 result_callback); 676 result_callback);
677 } 677 }
678 678
679 void WebContentsAndroid::OnContextMenuClosed(JNIEnv* env, 679 void WebContentsAndroid::OnContextMenuClosed(JNIEnv* env,
680 const JavaParamRef<jobject>& obj) { 680 const JavaParamRef<jobject>& obj) {
681 static_cast<WebContentsImpl*>(web_contents_) 681 static_cast<WebContentsImpl*>(web_contents_)
682 ->NotifyContextMenuClosed(CustomContextMenuContext()); 682 ->NotifyContextMenuClosed(CustomContextMenuContext());
683 } 683 }
684 684
685 void WebContentsAndroid::ReloadLoFiImages(JNIEnv* env,
686 const JavaParamRef<jobject>& obj) {
687 static_cast<WebContentsImpl*>(web_contents_)->ReloadLoFiImages();
688 }
689
685 void WebContentsAndroid::OnFinishGetContentBitmap( 690 void WebContentsAndroid::OnFinishGetContentBitmap(
686 ScopedJavaGlobalRef<jobject>* obj, 691 ScopedJavaGlobalRef<jobject>* obj,
687 ScopedJavaGlobalRef<jobject>* callback, 692 ScopedJavaGlobalRef<jobject>* callback,
688 const SkBitmap& bitmap, 693 const SkBitmap& bitmap,
689 ReadbackResponse response) { 694 ReadbackResponse response) {
690 JNIEnv* env = base::android::AttachCurrentThread(); 695 JNIEnv* env = base::android::AttachCurrentThread();
691 ScopedJavaLocalRef<jobject> java_bitmap; 696 ScopedJavaLocalRef<jobject> java_bitmap;
692 if (response == READBACK_SUCCESS) 697 if (response == READBACK_SUCCESS)
693 java_bitmap = gfx::ConvertToJavaBitmap(&bitmap); 698 java_bitmap = gfx::ConvertToJavaBitmap(&bitmap);
694 Java_WebContentsImpl_onGetContentBitmapFinished(env, 699 Java_WebContentsImpl_onGetContentBitmapFinished(env,
695 obj->obj(), 700 obj->obj(),
696 callback->obj(), 701 callback->obj(),
697 java_bitmap.obj(), 702 java_bitmap.obj(),
698 response); 703 response);
699 } 704 }
700 705
701 } // namespace content 706 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_android.h ('k') | content/browser/web_contents/web_contents_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698