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_array.h" | 10 #include "base/android/jni_array.h" |
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
818 void TabAndroid::LoadOfflineCopy(const GURL& url) { | 818 void TabAndroid::LoadOfflineCopy(const GURL& url) { |
819 GURL offline_url = offline_pages::OfflinePageUtils::GetOfflineURLForOnlineURL( | 819 GURL offline_url = offline_pages::OfflinePageUtils::GetOfflineURLForOnlineURL( |
820 GetProfile(), url); | 820 GetProfile(), url); |
821 if (!offline_url.is_valid()) | 821 if (!offline_url.is_valid()) |
822 return; | 822 return; |
823 | 823 |
824 content::NavigationController::LoadURLParams load_params(offline_url); | 824 content::NavigationController::LoadURLParams load_params(offline_url); |
825 web_contents()->GetController().LoadURLWithParams(load_params); | 825 web_contents()->GetController().LoadURLWithParams(load_params); |
826 } | 826 } |
827 | 827 |
828 void TabAndroid::OnLoFiResponseReceived() { | 828 void TabAndroid::OnLoFiResponseReceived(bool is_preview) { |
829 JNIEnv* env = base::android::AttachCurrentThread(); | 829 JNIEnv* env = base::android::AttachCurrentThread(); |
830 Java_Tab_onLoFiResponseReceived(env, weak_java_tab_.get(env).obj()); | 830 Java_Tab_onLoFiResponseReceived(env, weak_java_tab_.get(env).obj(), |
| 831 is_preview); |
831 } | 832 } |
832 | 833 |
833 jboolean TabAndroid::HasOfflineCopy(JNIEnv* env, | 834 jboolean TabAndroid::HasOfflineCopy(JNIEnv* env, |
834 const JavaParamRef<jobject>& obj) { | 835 const JavaParamRef<jobject>& obj) { |
835 GURL url = dom_distiller::url_utils::GetOriginalUrlFromDistillerUrl( | 836 GURL url = dom_distiller::url_utils::GetOriginalUrlFromDistillerUrl( |
836 web_contents()->GetURL()); | 837 web_contents()->GetURL()); |
837 return offline_pages::OfflinePageUtils::HasOfflinePageForOnlineURL( | 838 return offline_pages::OfflinePageUtils::HasOfflinePageForOnlineURL( |
838 GetProfile(), url); | 839 GetProfile(), url); |
839 } | 840 } |
840 | 841 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
942 static void Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { | 943 static void Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
943 TRACE_EVENT0("native", "TabAndroid::Init"); | 944 TRACE_EVENT0("native", "TabAndroid::Init"); |
944 // This will automatically bind to the Java object and pass ownership there. | 945 // This will automatically bind to the Java object and pass ownership there. |
945 new TabAndroid(env, obj); | 946 new TabAndroid(env, obj); |
946 } | 947 } |
947 | 948 |
948 // static | 949 // static |
949 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { | 950 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { |
950 return RegisterNativesImpl(env); | 951 return RegisterNativesImpl(env); |
951 } | 952 } |
OLD | NEW |