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" |
11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
12 #include "chrome/browser/profiles/profile_manager.h" | 12 #include "chrome/browser/profiles/profile_manager.h" |
13 #include "components/dom_distiller/core/experiments.h" | 13 #include "components/dom_distiller/core/experiments.h" |
14 #include "components/url_formatter/url_formatter.h" | 14 #include "components/url_formatter/url_formatter.h" |
15 #include "content/public/browser/web_contents.h" | 15 #include "content/public/browser/web_contents.h" |
16 #include "content/public/common/content_constants.h" | 16 #include "content/public/common/content_constants.h" |
17 #include "jni/DomDistillerTabUtils_jni.h" | 17 #include "jni/DomDistillerTabUtils_jni.h" |
18 #include "url/gurl.h" | 18 #include "url/gurl.h" |
19 | 19 |
| 20 using base::android::JavaParamRef; |
| 21 using base::android::ScopedJavaLocalRef; |
| 22 |
20 namespace android { | 23 namespace android { |
21 | 24 |
22 void DistillCurrentPageAndView(JNIEnv* env, | 25 void DistillCurrentPageAndView(JNIEnv* env, |
23 const JavaParamRef<jclass>& clazz, | 26 const JavaParamRef<jclass>& clazz, |
24 const JavaParamRef<jobject>& j_web_contents) { | 27 const JavaParamRef<jobject>& j_web_contents) { |
25 content::WebContents* web_contents = | 28 content::WebContents* web_contents = |
26 content::WebContents::FromJavaWebContents(j_web_contents); | 29 content::WebContents::FromJavaWebContents(j_web_contents); |
27 ::DistillCurrentPageAndView(web_contents); | 30 ::DistillCurrentPageAndView(web_contents); |
28 } | 31 } |
29 | 32 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 const JavaParamRef<jclass>& clazz) { | 66 const JavaParamRef<jclass>& clazz) { |
64 return dom_distiller::GetDistillerHeuristicsType() | 67 return dom_distiller::GetDistillerHeuristicsType() |
65 != dom_distiller::DistillerHeuristicsType::NONE; | 68 != dom_distiller::DistillerHeuristicsType::NONE; |
66 } | 69 } |
67 | 70 |
68 } // namespace android | 71 } // namespace android |
69 | 72 |
70 bool RegisterDomDistillerTabUtils(JNIEnv* env) { | 73 bool RegisterDomDistillerTabUtils(JNIEnv* env) { |
71 return android::RegisterNativesImpl(env); | 74 return android::RegisterNativesImpl(env); |
72 } | 75 } |
OLD | NEW |