Add new certificateProvider extension API.
[chromium-blink-merge.git] / chrome / browser / dom_distiller / dom_distiller_service_factory_android.cc
blobed9971c429aa752b8929d52f7e7be10c92967d25
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
3 // found in the LICENSE file.
5 #include "chrome/browser/dom_distiller/dom_distiller_service_factory_android.h"
7 #include "base/android/jni_android.h"
8 #include "chrome/browser/dom_distiller/dom_distiller_service_factory.h"
9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/profiles/profile_android.h"
11 #include "components/dom_distiller/core/dom_distiller_service_android.h"
12 #include "jni/DomDistillerServiceFactory_jni.h"
14 using base::android::ScopedJavaLocalRef;
16 namespace dom_distiller {
17 namespace android {
19 ScopedJavaLocalRef<jobject> DomDistillerServiceFactoryAndroid::GetForProfile(
20 JNIEnv* env,
21 jclass clazz,
22 jobject j_profile) {
23 dom_distiller::DomDistillerService* service =
24 dom_distiller::DomDistillerServiceFactory::GetForBrowserContext(
25 ProfileAndroid::FromProfileAndroid(j_profile));
26 DomDistillerServiceAndroid* service_android =
27 new DomDistillerServiceAndroid(service);
28 return ScopedJavaLocalRef<jobject>(service_android->java_ref_);
31 bool DomDistillerServiceFactoryAndroid::Register(JNIEnv* env) {
32 return RegisterNativesImpl(env);
35 ScopedJavaLocalRef<jobject> GetForProfile(
36 JNIEnv* env,
37 const JavaParamRef<jclass>& clazz,
38 const JavaParamRef<jobject>& j_profile) {
39 return DomDistillerServiceFactoryAndroid::GetForProfile(env, clazz,
40 j_profile);
43 } // namespace android
44 } // namespace dom_distiller