Chromium Code Reviews| 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..53857d703d1b8f69e860ae95378f007e1fd60dea |
| --- /dev/null |
| +++ b/chrome/browser/dom_distiller/dom_distiller_service_factory_android.cc |
| @@ -0,0 +1,27 @@ |
| +// 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" |
| + |
| +#include "chrome/browser/dom_distiller/dom_distiller_service_factory.h" |
| +#include "chrome/browser/dom_distiller/dom_distiller_service_factory_android.h" |
| +#include "chrome/browser/profiles/profile.h" |
| +#include "chrome/browser/profiles/profile_android.h" |
| + |
| +#include "jni/DomDistillerServiceFactory_jni.h" |
| + |
| +static jlong GetDomDistillerServiceForProfile(JNIEnv* env, |
|
nyquist
2014/06/30 20:33:22
Could this instead return the jobject for DomDisti
sunangel
2014/07/07 21:21:29
Done.
|
| + jclass clazz, |
| + jobject j_profile) { |
| + Profile* nativeProfilePointer = ProfileAndroid::FromProfileAndroid(j_profile); |
|
nyquist
2014/06/30 20:33:22
Just |profile|
sunangel
2014/07/07 21:21:29
Done.
|
| + dom_distiller::DomDistillerService* service = |
| + dom_distiller::DomDistillerServiceFactory::GetForBrowserContext( |
| + nativeProfilePointer); |
| + return reinterpret_cast<intptr_t>(service); |
|
nyquist
2014/06/30 20:33:23
I think here you can new the DomDistillerServiceAn
sunangel
2014/07/07 21:21:29
Done.
|
| +} |
| + |
| +bool RegisterDomDistillerServiceFactory(JNIEnv* env) { |
| + return RegisterNativesImpl(env); |
| +} |