OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/android/tab_android.h" | 5 #include "chrome/browser/android/tab_android.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 } | 805 } |
806 | 806 |
807 return -1; | 807 return -1; |
808 } | 808 } |
809 | 809 |
810 void TabAndroid::ShowOfflinePages() { | 810 void TabAndroid::ShowOfflinePages() { |
811 JNIEnv* env = base::android::AttachCurrentThread(); | 811 JNIEnv* env = base::android::AttachCurrentThread(); |
812 Java_Tab_showOfflinePages(env, weak_java_tab_.get(env)); | 812 Java_Tab_showOfflinePages(env, weak_java_tab_.get(env)); |
813 } | 813 } |
814 | 814 |
815 void TabAndroid::OnLoFiResponseReceived(bool is_preview) { | |
816 JNIEnv* env = base::android::AttachCurrentThread(); | |
817 Java_Tab_onLoFiResponseReceived(env, weak_java_tab_.get(env), is_preview); | |
818 } | |
819 | |
820 jboolean TabAndroid::IsOfflinePage(JNIEnv* env, | 815 jboolean TabAndroid::IsOfflinePage(JNIEnv* env, |
821 const JavaParamRef<jobject>& obj) { | 816 const JavaParamRef<jobject>& obj) { |
822 return offline_pages::OfflinePageUtils::GetOfflinePageFromWebContents( | 817 return offline_pages::OfflinePageUtils::GetOfflinePageFromWebContents( |
823 web_contents()) != nullptr; | 818 web_contents()) != nullptr; |
824 } | 819 } |
825 | 820 |
826 ScopedJavaLocalRef<jobject> TabAndroid::GetOfflinePage( | 821 ScopedJavaLocalRef<jobject> TabAndroid::GetOfflinePage( |
827 JNIEnv* env, | 822 JNIEnv* env, |
828 const JavaParamRef<jobject>& obj) { | 823 const JavaParamRef<jobject>& obj) { |
829 const offline_pages::OfflinePageItem* offline_page = | 824 const offline_pages::OfflinePageItem* offline_page = |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
918 static void Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { | 913 static void Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
919 TRACE_EVENT0("native", "TabAndroid::Init"); | 914 TRACE_EVENT0("native", "TabAndroid::Init"); |
920 // This will automatically bind to the Java object and pass ownership there. | 915 // This will automatically bind to the Java object and pass ownership there. |
921 new TabAndroid(env, obj); | 916 new TabAndroid(env, obj); |
922 } | 917 } |
923 | 918 |
924 // static | 919 // static |
925 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { | 920 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { |
926 return RegisterNativesImpl(env); | 921 return RegisterNativesImpl(env); |
927 } | 922 } |
OLD | NEW |