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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/ContentSettings.java

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
Index: content/public/android/java/src/org/chromium/content/browser/ContentSettings.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentSettings.java b/content/public/android/java/src/org/chromium/content/browser/ContentSettings.java
deleted file mode 100644
index eb79f3e402f250a2ab8694111cd01fe1c2a949af..0000000000000000000000000000000000000000
--- a/content/public/android/java/src/org/chromium/content/browser/ContentSettings.java
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright 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.
-
-package org.chromium.content.browser;
-
-import org.chromium.base.CalledByNative;
-import org.chromium.base.JNINamespace;
-import org.chromium.base.ThreadUtils;
-
-/**
- * Manages settings state for a ContentView. A ContentSettings instance is obtained
- * from ContentViewCore.getContentSettings().
- */
-@JNINamespace("content")
-public class ContentSettings {
-
- private static final String TAG = "ContentSettings";
-
- // The native side of this object. Ownership is retained native-side by the WebContents
- // instance that backs the associated ContentViewCore.
- private long mNativeContentSettings = 0;
-
- private ContentViewCore mContentViewCore;
-
- /**
- * Package constructor to prevent clients from creating a new settings
- * instance. Must be called on the UI thread.
- */
- ContentSettings(ContentViewCore contentViewCore, long nativeContentView) {
- ThreadUtils.assertOnUiThread();
- mContentViewCore = contentViewCore;
- mNativeContentSettings = nativeInit(nativeContentView);
- assert mNativeContentSettings != 0;
- }
-
- /**
- * Notification from the native side that it is being destroyed.
- * @param nativeContentSettings the native instance that is going away.
- */
- @CalledByNative
- private void onNativeContentSettingsDestroyed(long nativeContentSettings) {
- assert mNativeContentSettings == nativeContentSettings;
- mNativeContentSettings = 0;
- }
-
- /**
- * Return true if JavaScript is enabled. Must be called on the UI thread.
- *
- * @return True if JavaScript is enabled.
- */
- public boolean getJavaScriptEnabled() {
- ThreadUtils.assertOnUiThread();
- return mNativeContentSettings != 0
- ? nativeGetJavaScriptEnabled(mNativeContentSettings) : false;
- }
-
- // Initialize the ContentSettings native side.
- private native long nativeInit(long contentViewPtr);
-
- private native boolean nativeGetJavaScriptEnabled(long nativeContentSettings);
-}
« no previous file with comments | « content/content_jni.gypi ('k') | content/public/android/java/src/org/chromium/content/browser/ContentViewClient.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698