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

Unified Diff: content/shell/android/java/org/chromium/content_shell/ShellManager.java

Issue 10035034: Implement the skeleton of an android content shell. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed drawable png as it was checked in separately. Created 8 years, 8 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/shell/android/java/org/chromium/content_shell/ShellManager.java
diff --git a/content/shell/android/java/org/chromium/content_shell/ShellManager.java b/content/shell/android/java/org/chromium/content_shell/ShellManager.java
new file mode 100644
index 0000000000000000000000000000000000000000..7ea2906d25351885cc3228068d01d7b29bd2027a
--- /dev/null
+++ b/content/shell/android/java/org/chromium/content_shell/ShellManager.java
@@ -0,0 +1,52 @@
+// 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.
+
+package org.chromium.content_shell;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.view.LayoutInflater;
+import android.widget.FrameLayout;
+
+import org.chromium.base.CalledByNative;
+
+/**
+ * Container and generator of ShellViews.
+ */
+public class ShellManager extends FrameLayout {
+
+ private ShellView mActiveShellView;
+
+ /**
+ * Constructor for inflating via XML.
+ */
+ public ShellManager(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ nativeInit(this);
+ }
+
+ /**
+ * @return The currently visible shell view or null if one is not showing.
+ */
+ protected ShellView getActiveShellView() {
+ return mActiveShellView;
+ }
+
+ @SuppressWarnings("unused")
+ @CalledByNative
+ private int createShell() {
+ LayoutInflater inflater =
+ (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ ShellView shellView = (ShellView) inflater.inflate(R.layout.shell_view, null);
+
+ removeAllViews();
+ addView(shellView, new FrameLayout.LayoutParams(
+ FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT));
+ mActiveShellView = shellView;
+
+ return shellView.getNativeShellView();
+ }
+
+ private static native void nativeInit(Object shellManagerInstance);
+}

Powered by Google App Engine
This is Rietveld 408576698