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

Unified Diff: android_webview/java/src/org/chromium/android_webview/AwBrowserContext.java

Issue 12208099: Create java AwBrowserContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 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 | « no previous file | android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/java/src/org/chromium/android_webview/AwBrowserContext.java
diff --git a/android_webview/java/src/org/chromium/android_webview/AwBrowserContext.java b/android_webview/java/src/org/chromium/android_webview/AwBrowserContext.java
new file mode 100644
index 0000000000000000000000000000000000000000..7842c20de2e3834121d7ea38fcd5dd1e760896b9
--- /dev/null
+++ b/android_webview/java/src/org/chromium/android_webview/AwBrowserContext.java
@@ -0,0 +1,50 @@
+// Copyright (c) 2013 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.android_webview;
+
+import android.content.Context;
+import android.content.SharedPreferences;
+
+import org.chromium.base.PathUtils;
+import org.chromium.base.ThreadUtils;
+import org.chromium.content.app.LibraryLoader;
+import org.chromium.content.browser.AndroidBrowserProcess;
+import org.chromium.content.browser.ResourceExtractor;
+import org.chromium.content.common.ProcessInitException;
+
+/**
+ * Java side of the Browser Context: contains all the java side objects needed to host one
+ * browing session (i.e. profile).
+ * Note that due to running in single process mode, and limitations on renderer process only
+ * being able to use a single browser context, currently there can only be one AwBrowserContext
+ * instance, so at this point the class mostly exists for conceptual clarity.
+ *
+ * Obtain the default (singleton) instance with AwBrowserProcess.getDefaultBrowserContext().
+ */
+public class AwBrowserContext {
+
+ private SharedPreferences mSharedPreferences;
+
+ private AwGeolocationPermissions mGeolocationPermissions;
+ private AwCookieManager mCookieManager;
+
+ public AwBrowserContext(SharedPreferences sharedPreferences) {
+ mSharedPreferences = sharedPreferences;
+ }
+
+ public AwGeolocationPermissions getGeolocationPermissions() {
+ if (mGeolocationPermissions == null) {
+ mGeolocationPermissions = new AwGeolocationPermissions(mSharedPreferences);
+ }
+ return mGeolocationPermissions;
+ }
+
+ public AwCookieManager getCookieManager() {
+ if (mCookieManager == null) {
+ mCookieManager = new AwCookieManager();
+ }
+ return mCookieManager;
+ }
+}
« no previous file with comments | « no previous file | android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698