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

Side by Side Diff: components/dom_distiller/core/distilled_page_prefs_android.cc

Issue 340403004: Java wrapper for DistilledPagePrefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: modified DEPS for test dependencies 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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.
4
5 #include "components/dom_distiller/core/distilled_page_prefs_android.h"
6
7 #include "components/dom_distiller/core/distilled_page_prefs.h"
8 #include "components/dom_distiller/core/dom_distiller_service.h"
9 #include "jni/DistilledPagePrefs_jni.h"
10
11 namespace dom_distiller {
12 namespace android {
13
14 DistilledPagePrefsAndroid::DistilledPagePrefsAndroid(
15 JNIEnv* env,
16 jobject obj,
17 DistilledPagePrefs* distillerPagePrefsPtr)
18 : distilled_page_prefs_(distillerPagePrefsPtr) {
19 }
20
21 DistilledPagePrefsAndroid::~DistilledPagePrefsAndroid() {
22 }
23
24 void DistilledPagePrefsAndroid::SetTheme(JNIEnv* env, jobject obj, jint theme) {
25 distilled_page_prefs_->SetTheme((DistilledPagePrefs::Theme)theme);
26 }
27
28 jint DistilledPagePrefsAndroid::GetTheme(JNIEnv* env, jobject obj) {
29 return (int)distilled_page_prefs_->GetTheme();
30 }
31
32 jlong Init(JNIEnv* env, jobject obj, jlong distilledPagePrefsPtr) {
33 DistilledPagePrefs* distilledPagePrefs =
34 reinterpret_cast<DistilledPagePrefs*>(distilledPagePrefsPtr);
35 DistilledPagePrefsAndroid* distilled_page_prefs_android =
36 new DistilledPagePrefsAndroid(env, obj, distilledPagePrefs);
37 return reinterpret_cast<intptr_t>(distilled_page_prefs_android);
38 }
39
40 bool DistilledPagePrefsAndroid::Register(JNIEnv* env) {
41 return RegisterNativesImpl(env);
42 }
43
44 } // namespace android
45 } // namespace dom_distiller
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698