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

Unified Diff: chrome/browser/dom_distiller/dom_distiller_service_factory_android.cc

Issue 340403004: Java wrapper for DistilledPagePrefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: namespaces to classes, native init, enum Created 6 years, 5 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/dom_distiller/dom_distiller_service_factory_android.cc
diff --git a/chrome/browser/dom_distiller/dom_distiller_service_factory_android.cc b/chrome/browser/dom_distiller/dom_distiller_service_factory_android.cc
new file mode 100644
index 0000000000000000000000000000000000000000..087c34fa3b8c21bab0b4cc5382247c22ba2a23ed
--- /dev/null
+++ b/chrome/browser/dom_distiller/dom_distiller_service_factory_android.cc
@@ -0,0 +1,41 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/android/jni_android.h"
+#include "base/android/jni_string.h"
+
nyquist 2014/07/08 01:02:32 remove empty line
sunangel 2014/07/08 20:40:56 Done.
+#include "chrome/browser/dom_distiller/dom_distiller_service_factory.h"
+#include "chrome/browser/dom_distiller/dom_distiller_service_factory_android.h"
nyquist 2014/07/08 01:02:32 this include should go at the top, and then an emp
sunangel 2014/07/08 20:40:56 Done.
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/profiles/profile_android.h"
+
nyquist 2014/07/08 01:02:32 remove empty line
sunangel 2014/07/08 20:40:57 Done.
+#include "components/dom_distiller/core/dom_distiller_service_android.h"
+
nyquist 2014/07/08 01:02:32 remove empty line
sunangel 2014/07/08 20:40:57 Done.
+#include "jni/DomDistillerServiceFactory_jni.h"
+
+using base::android::ScopedJavaLocalRef;
+
+namespace dom_distiller{
+namespace android {
+
+jobject DomDistillerServiceFactoryAndroid::GetForProfile(
+ JNIEnv* env, jclass clazz, jobject j_profile) {
+ dom_distiller::DomDistillerService* service =
+ dom_distiller::DomDistillerServiceFactory::GetForBrowserContext(
+ ProfileAndroid::FromProfileAndroid(j_profile));
+ DomDistillerServiceAndroid* d = new DomDistillerServiceAndroid(service);
nyquist 2014/07/08 01:02:32 service_android
sunangel 2014/07/08 20:40:57 Done.
+ return d->java_ref_.obj();
+}
+
+bool DomDistillerServiceFactoryAndroid::Register(JNIEnv* env) {
+ return RegisterNativesImpl(env);
+}
+
+jobject GetForProfile(JNIEnv* env, jclass clazz, jobject j_profile){
+ return DomDistillerServiceFactoryAndroid::GetForProfile(
+ env, clazz, j_profile);
+}
+
+} // namespace android
+} // namespace dom_distiller

Powered by Google App Engine
This is Rietveld 408576698