| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |