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

Side by Side Diff: chrome/browser/dom_distiller/tab_utils_android.cc

Issue 2342873005: Disable Reader Mode when requesting desktop site (Closed)
Patch Set: fix tests Created 4 years, 3 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
« no previous file with comments | « chrome/android/javatests/src/org/chromium/chrome/browser/dom_distiller/ReaderModeManagerTest.java ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/dom_distiller/tab_utils_android.h" 5 #include "chrome/browser/dom_distiller/tab_utils_android.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/android/jni_string.h" 9 #include "base/android/jni_string.h"
10 #include "chrome/browser/dom_distiller/tab_utils.h" 10 #include "chrome/browser/dom_distiller/tab_utils.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 61
62 // Returns true if the distiller experiment is set to use any heuristic other 62 // Returns true if the distiller experiment is set to use any heuristic other
63 // than "NONE". This is used to prevent the Reader Mode panel from loading 63 // than "NONE". This is used to prevent the Reader Mode panel from loading
64 // when it would otherwise never be shown. 64 // when it would otherwise never be shown.
65 jboolean IsDistillerHeuristicsEnabled(JNIEnv* env, 65 jboolean IsDistillerHeuristicsEnabled(JNIEnv* env,
66 const JavaParamRef<jclass>& clazz) { 66 const JavaParamRef<jclass>& clazz) {
67 return dom_distiller::GetDistillerHeuristicsType() 67 return dom_distiller::GetDistillerHeuristicsType()
68 != dom_distiller::DistillerHeuristicsType::NONE; 68 != dom_distiller::DistillerHeuristicsType::NONE;
69 } 69 }
70 70
71 // Returns true if distiller is reporting every page as distillable.
72 jboolean IsHeuristicAlwaysTrue(JNIEnv* env,
73 const JavaParamRef<jclass>& clazz) {
74 return dom_distiller::GetDistillerHeuristicsType()
75 == dom_distiller::DistillerHeuristicsType::ALWAYS_TRUE;
76 }
77
71 } // namespace android 78 } // namespace android
72 79
73 bool RegisterDomDistillerTabUtils(JNIEnv* env) { 80 bool RegisterDomDistillerTabUtils(JNIEnv* env) {
74 return android::RegisterNativesImpl(env); 81 return android::RegisterNativesImpl(env);
75 } 82 }
OLDNEW
« no previous file with comments | « chrome/android/javatests/src/org/chromium/chrome/browser/dom_distiller/ReaderModeManagerTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698