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

Unified Diff: content/browser/android/content_settings.cc

Issue 920693003: Revert "Revert of [Android] Migrate javascript settings to a content setting from a pref. (patchset… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove jni registration Created 5 years, 10 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
« no previous file with comments | « content/browser/android/content_settings.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/android/content_settings.cc
diff --git a/content/browser/android/content_settings.cc b/content/browser/android/content_settings.cc
deleted file mode 100644
index 2d32143807a9e5ce068e1af873c68e23676813ee..0000000000000000000000000000000000000000
--- a/content/browser/android/content_settings.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright (c) 2012 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 "content/browser/android/content_settings.h"
-
-#include "base/android/jni_android.h"
-#include "content/browser/android/content_view_core_impl.h"
-#include "content/browser/renderer_host/render_view_host_delegate.h"
-#include "content/browser/renderer_host/render_view_host_impl.h"
-#include "content/public/browser/web_contents.h"
-#include "content/public/common/web_preferences.h"
-#include "jni/ContentSettings_jni.h"
-
-namespace content {
-
-ContentSettings::ContentSettings(JNIEnv* env,
- jobject obj,
- WebContents* contents)
- : WebContentsObserver(contents),
- content_settings_(env, obj) {
-}
-
-ContentSettings::~ContentSettings() {
- JNIEnv* env = base::android::AttachCurrentThread();
- ScopedJavaLocalRef<jobject> obj = content_settings_.get(env);
- if (obj.obj()) {
- Java_ContentSettings_onNativeContentSettingsDestroyed(env, obj.obj(),
- reinterpret_cast<intptr_t>(this));
- }
-}
-
-// static
-bool ContentSettings::RegisterContentSettings(JNIEnv* env) {
- return RegisterNativesImpl(env);
-}
-
-bool ContentSettings::GetJavaScriptEnabled(JNIEnv* env, jobject obj) {
- RenderViewHost* render_view_host = web_contents()->GetRenderViewHost();
- if (!render_view_host)
- return false;
- return render_view_host->GetWebkitPreferences().javascript_enabled;
-}
-
-void ContentSettings::WebContentsDestroyed() {
- delete this;
-}
-
-static jlong Init(JNIEnv* env, jobject obj, jlong nativeContentViewCore) {
- WebContents* web_contents =
- reinterpret_cast<ContentViewCoreImpl*>(nativeContentViewCore)
- ->GetWebContents();
- ContentSettings* content_settings =
- new ContentSettings(env, obj, web_contents);
- return reinterpret_cast<intptr_t>(content_settings);
-}
-
-} // namespace content
« no previous file with comments | « content/browser/android/content_settings.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698