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

Side by Side Diff: chrome/browser/android/tab_android.cc

Issue 1558553002: Lo-Fi snackbar should only be shown for the first q=low response of a page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test fix Created 4 years, 11 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 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
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() {
829 JNIEnv* env = base::android::AttachCurrentThread();
830 Java_Tab_onLoFiResponseReceived(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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/android/tab_android.h ('k') | chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_io_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698