OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/dom_distiller/distiller_ui_handle_android.h" | 5 #include "chrome/browser/android/dom_distiller/distiller_ui_handle_android.h" |
6 | 6 |
7 #include "base/android/jni_string.h" | 7 #include "base/android/jni_string.h" |
8 #include "chrome/browser/ui/android/view_android_helper.h" | 8 #include "chrome/browser/ui/android/view_android_helper.h" |
9 #include "components/dom_distiller/core/url_utils.h" | 9 #include "components/dom_distiller/core/url_utils.h" |
10 #include "content/public/browser/web_contents.h" | 10 #include "content/public/browser/web_contents.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 const GURL& url, | 24 const GURL& url, |
25 const bool good) { | 25 const bool good) { |
26 if (!web_contents) | 26 if (!web_contents) |
27 return; | 27 return; |
28 | 28 |
29 JNIEnv* env = base::android::AttachCurrentThread(); | 29 JNIEnv* env = base::android::AttachCurrentThread(); |
30 ScopedJavaLocalRef<jstring> jurl = base::android::ConvertUTF8ToJavaString( | 30 ScopedJavaLocalRef<jstring> jurl = base::android::ConvertUTF8ToJavaString( |
31 env, url_utils::GetOriginalUrlFromDistillerUrl(url).spec()); | 31 env, url_utils::GetOriginalUrlFromDistillerUrl(url).spec()); |
32 | 32 |
33 Java_DomDistillerUIUtils_reportFeedbackWithWebContents( | 33 Java_DomDistillerUIUtils_reportFeedbackWithWebContents( |
34 env, web_contents->GetJavaWebContents().obj(), jurl.obj(), good); | 34 env, web_contents->GetJavaWebContents(), jurl, good); |
35 } | 35 } |
36 | 36 |
37 // static | 37 // static |
38 void DistillerUIHandleAndroid::OpenSettings( | 38 void DistillerUIHandleAndroid::OpenSettings( |
39 content::WebContents* web_contents) { | 39 content::WebContents* web_contents) { |
40 JNIEnv* env = base::android::AttachCurrentThread(); | 40 JNIEnv* env = base::android::AttachCurrentThread(); |
41 Java_DomDistillerUIUtils_openSettings(env, | 41 Java_DomDistillerUIUtils_openSettings(env, |
42 web_contents->GetJavaWebContents().obj()); | 42 web_contents->GetJavaWebContents()); |
43 } | 43 } |
44 | 44 |
45 // static | 45 // static |
46 void DistillerUIHandleAndroid::ClosePanel(bool animate) { | 46 void DistillerUIHandleAndroid::ClosePanel(bool animate) { |
47 JNIEnv* env = base::android::AttachCurrentThread(); | 47 JNIEnv* env = base::android::AttachCurrentThread(); |
48 Java_DomDistillerUIUtils_closePanel(env, animate); | 48 Java_DomDistillerUIUtils_closePanel(env, animate); |
49 } | 49 } |
50 | 50 |
51 } // namespace android | 51 } // namespace android |
52 | 52 |
53 } // namespace dom_distiller | 53 } // namespace dom_distiller |
OLD | NEW |