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::NotifyLoFiResponseReceived() { | |
newt (away)
2016/01/06 19:03:27
how about calling this "OnLoFi...", which is the m
megjablon
2016/01/07 21:22:05
Done.
| |
829 JNIEnv* env = base::android::AttachCurrentThread(); | |
830 Java_Tab_notifyLoFiResponseReceived(env, weak_java_tab_.get(env).obj()); | |
831 } | |
832 | |
828 jboolean TabAndroid::HasOfflineCopy(JNIEnv* env, | 833 jboolean TabAndroid::HasOfflineCopy(JNIEnv* env, |
829 const JavaParamRef<jobject>& obj) { | 834 const JavaParamRef<jobject>& obj) { |
830 GURL url = dom_distiller::url_utils::GetOriginalUrlFromDistillerUrl( | 835 GURL url = dom_distiller::url_utils::GetOriginalUrlFromDistillerUrl( |
831 web_contents()->GetURL()); | 836 web_contents()->GetURL()); |
832 return offline_pages::OfflinePageUtils::HasOfflinePageForOnlineURL( | 837 return offline_pages::OfflinePageUtils::HasOfflinePageForOnlineURL( |
833 GetProfile(), url); | 838 GetProfile(), url); |
834 } | 839 } |
835 | 840 |
836 jboolean TabAndroid::IsOfflinePage(JNIEnv* env, | 841 jboolean TabAndroid::IsOfflinePage(JNIEnv* env, |
837 const JavaParamRef<jobject>& obj) { | 842 const JavaParamRef<jobject>& obj) { |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
937 static void Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { | 942 static void Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
938 TRACE_EVENT0("native", "TabAndroid::Init"); | 943 TRACE_EVENT0("native", "TabAndroid::Init"); |
939 // This will automatically bind to the Java object and pass ownership there. | 944 // This will automatically bind to the Java object and pass ownership there. |
940 new TabAndroid(env, obj); | 945 new TabAndroid(env, obj); |
941 } | 946 } |
942 | 947 |
943 // static | 948 // static |
944 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { | 949 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { |
945 return RegisterNativesImpl(env); | 950 return RegisterNativesImpl(env); |
946 } | 951 } |
OLD | NEW |