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

Unified Diff: chrome/browser/android/dom_distiller/distiller_ui_handle_android.cc

Issue 1386043002: Open distiller UI setting through JavaScript (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add missing file Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/dom_distiller/distiller_ui_handle_android.cc
diff --git a/chrome/browser/android/dom_distiller/external_feedback_reporter_android.cc b/chrome/browser/android/dom_distiller/distiller_ui_handle_android.cc
similarity index 58%
rename from chrome/browser/android/dom_distiller/external_feedback_reporter_android.cc
rename to chrome/browser/android/dom_distiller/distiller_ui_handle_android.cc
index 04cf18ae96735b39ccd78a42dd3bd8251ebeb287..2b40dabb812e3f26d563b9db3a31c81b24f2f3dd 100644
--- a/chrome/browser/android/dom_distiller/external_feedback_reporter_android.cc
+++ b/chrome/browser/android/dom_distiller/distiller_ui_handle_android.cc
@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/android/dom_distiller/external_feedback_reporter_android.h"
+#include "chrome/browser/android/dom_distiller/distiller_ui_handle_android.h"
#include "base/android/jni_string.h"
#include "chrome/browser/ui/android/window_android_helper.h"
#include "components/dom_distiller/core/url_utils.h"
#include "content/public/browser/web_contents.h"
-#include "jni/DomDistillerFeedbackReporter_jni.h"
+#include "jni/DomDistillerUIUtils_jni.h"
#include "ui/android/window_android.h"
#include "url/gurl.h"
@@ -16,31 +16,32 @@ namespace dom_distiller {
namespace android {
-// ExternalFeedbackReporter implementation.
-void ExternalFeedbackReporterAndroid::ReportExternalFeedback(
+// static
+void DistillerUIHandleAndroid::ReportExternalFeedback(
content::WebContents* web_contents,
const GURL& url,
const bool good) {
if (!web_contents)
return;
- WindowAndroidHelper* helper =
- content::WebContentsUserData<WindowAndroidHelper>::FromWebContents(
- web_contents);
- DCHECK(helper);
-
- ui::WindowAndroid* window = helper->GetWindowAndroid();
- DCHECK(window);
JNIEnv* env = base::android::AttachCurrentThread();
ScopedJavaLocalRef<jstring> jurl = base::android::ConvertUTF8ToJavaString(
env, url_utils::GetOriginalUrlFromDistillerUrl(url).spec());
- Java_DomDistillerFeedbackReporter_reportFeedbackWithWindow(
- env, window->GetJavaObject().obj(), jurl.obj(), good);
+ Java_DomDistillerUIUtils_reportFeedbackWithWebContents(
+ env, web_contents->GetJavaWebContents().obj(), jurl.obj(), good);
+}
+
+// static
+void DistillerUIHandleAndroid::OpenSettings(
+ content::WebContents* web_contents) {
+ JNIEnv* env = base::android::AttachCurrentThread();
+ Java_DomDistillerUIUtils_openSettings(env,
+ web_contents->GetJavaWebContents().obj());
}
// static
-bool RegisterFeedbackReporter(JNIEnv* env) {
+bool RegisterUIHandle(JNIEnv* env) {
return RegisterNativesImpl(env);
}

Powered by Google App Engine
This is Rietveld 408576698