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

Side by Side 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: Remove unnecessary bits. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 package org.chromium.content_shell;
6
7 import android.content.Context;
8 import android.util.AttributeSet;
9 import android.view.LayoutInflater;
10 import android.widget.FrameLayout;
11
12 import org.chromium.base.CalledByNative;
13
14 /**
15 * Container and generator of ShellViews.
16 */
17 public class ShellManager extends FrameLayout {
18
19 private ShellView mActiveShellView;
20
21 /**
22 * Constructor for inflating via XML.
23 */
24 public ShellManager(Context context, AttributeSet attrs) {
25 super(context, attrs);
26 nativeInit(this);
27 }
28
29 /**
30 * @return The currently visible shell view or null if one is not showing.
31 */
32 protected ShellView getActiveShellView() {
33 return mActiveShellView;
34 }
35
36 @SuppressWarnings("unused")
37 @CalledByNative
38 private int createShell() {
39 LayoutInflater inflater =
40 (LayoutInflater) getContext().getSystemService(Context.LAYOUT_IN FLATER_SERVICE);
41 ShellView shellView = (ShellView) inflater.inflate(R.layout.shell_view, null);
42
43 removeAllViews();
44 addView(shellView, new FrameLayout.LayoutParams(
45 FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams. MATCH_PARENT));
46 mActiveShellView = shellView;
47
48 return shellView.getNativeShellView();
49 }
50
51 private static native void nativeInit(Object shellManagerInstance);
52 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698