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

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

Issue 340403004: Java wrapper for DistilledPagePrefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Spacing issues Created 6 years, 6 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/dom_distiller/core/profile_utils_android.h" 5 #include "components/dom_distiller/core/profile_utils_android.h"
6 #include <string> 6 #include "components/dom_distiller/core/reader_mode_preferences.h"
7 #include "base/android/jni_string.h" 7
8 #include "jni/ProfileUtils_jni.h" 8 #include "jni/ProfileUtils_jni.h"
9 #include <sstream> 9
10 10
11 namespace dom_distiller { 11 namespace dom_distiller {
12 12
13 namespace profile_utils { 13 namespace profile_utils {
14 14
15 namespace android { 15 namespace android {
16 16
17 jstring SetHighContrastMode(JNIEnv* env, jobject obj, jlong ptr, jboolean enable d) { 17 void SetHighContrastMode(JNIEnv* env, jobject obj, jlong ptr,
robliao 2014/06/20 21:13:45 Apply 80 Character limit.
sunangel 2014/06/24 00:03:43 Done.
18 // ProfileManager::GetActiveUserProfile()->GetOriginalProfile(); 18 jboolean enabled) {
19 std::stringstream ss; 19 ReaderModePrefs* myReaderModePrefs =
20 ss << ptr; 20 reinterpret_cast<ReaderModePrefs*> (ptr);
robliao 2014/06/20 21:13:45 Remove space between > and (
sunangel 2014/06/24 00:03:43 Done.
21 std::string s = "profile utils.cc called and the long we got was "+ss.str(); 21 DCHECK(myReaderModePrefs);
robliao 2014/06/20 21:13:45 A DCHECK isn't necessary here. We're going to cras
sunangel 2014/06/24 00:03:43 Done.
22 22 myReaderModePrefs->GetHighContrastPref();
23 return base::android::ConvertUTF8ToJavaString(env, s).Release(); 23 myReaderModePrefs->OnChangeHighContrast(enabled);
24 } 24 }
25 25
26
27
28 bool RegisterProfileUtils(JNIEnv* env) { return RegisterNativesImpl(env); } 26 bool RegisterProfileUtils(JNIEnv* env) { return RegisterNativesImpl(env); }
29 27
30
31 } // namespace android 28 } // namespace android
32 29
33 } // namespace url_utils 30 } // namespace profile_utils
34 31
35 } // namespace dom_distiller 32 } // namespace dom_distiller
OLDNEW
« no previous file with comments | « components/dom_distiller/core/profile_utils_android.h ('k') | components/dom_distiller/core/reader_mode_preferences.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698