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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: components/dom_distiller/core/profile_utils_android.cc
diff --git a/components/dom_distiller/core/profile_utils_android.cc b/components/dom_distiller/core/profile_utils_android.cc
index 50c22df06b4cb40de57ac6df0370efd7b8299274..fba99e8128e4eb5a4e41fd3324a92c87c14fb234 100644
--- a/components/dom_distiller/core/profile_utils_android.cc
+++ b/components/dom_distiller/core/profile_utils_android.cc
@@ -3,10 +3,10 @@
// found in the LICENSE file.
#include "components/dom_distiller/core/profile_utils_android.h"
-#include <string>
-#include "base/android/jni_string.h"
+#include "components/dom_distiller/core/reader_mode_preferences.h"
+
#include "jni/ProfileUtils_jni.h"
-#include <sstream>
+
namespace dom_distiller {
@@ -14,22 +14,19 @@ namespace profile_utils {
namespace android {
-jstring SetHighContrastMode(JNIEnv* env, jobject obj, jlong ptr, jboolean enabled) {
- // ProfileManager::GetActiveUserProfile()->GetOriginalProfile();
- std::stringstream ss;
- ss << ptr;
- std::string s = "profile utils.cc called and the long we got was "+ss.str();
-
- return base::android::ConvertUTF8ToJavaString(env, s).Release();
+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.
+ jboolean enabled) {
+ ReaderModePrefs* myReaderModePrefs =
+ reinterpret_cast<ReaderModePrefs*> (ptr);
robliao 2014/06/20 21:13:45 Remove space between > and (
sunangel 2014/06/24 00:03:43 Done.
+ 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.
+ myReaderModePrefs->GetHighContrastPref();
+ myReaderModePrefs->OnChangeHighContrast(enabled);
}
-
-
bool RegisterProfileUtils(JNIEnv* env) { return RegisterNativesImpl(env); }
-
} // namespace android
-} // namespace url_utils
+} // namespace profile_utils
} // namespace dom_distiller
« 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