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

Side by Side Diff: content/shell/android/java/src/org/chromium/content_shell/ShellManager.java

Issue 10701177: Make content shell on android support relaunching. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase and removed unnecessary content:: namespacing. Created 8 years, 5 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.content_shell; 5 package org.chromium.content_shell;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 import android.util.AttributeSet; 8 import android.util.AttributeSet;
9 import android.view.LayoutInflater; 9 import android.view.LayoutInflater;
10 import android.widget.FrameLayout; 10 import android.widget.FrameLayout;
(...skipping 17 matching lines...) Expand all
28 nativeInit(this); 28 nativeInit(this);
29 } 29 }
30 30
31 /** 31 /**
32 * @return The currently visible shell view or null if one is not showing. 32 * @return The currently visible shell view or null if one is not showing.
33 */ 33 */
34 protected Shell getActiveShell() { 34 protected Shell getActiveShell() {
35 return mActiveShell; 35 return mActiveShell;
36 } 36 }
37 37
38 /**
39 * Creates a new shell pointing to the specified URL.
40 * @param url The URL the shell should load upon creation.
41 */
42 public void launchShell(String url) {
43 nativeLaunchShell(url);
44 }
45
38 @SuppressWarnings("unused") 46 @SuppressWarnings("unused")
39 @CalledByNative 47 @CalledByNative
40 private Object createShell() { 48 private Object createShell() {
41 LayoutInflater inflater = 49 LayoutInflater inflater =
42 (LayoutInflater) getContext().getSystemService(Context.LAYOUT_IN FLATER_SERVICE); 50 (LayoutInflater) getContext().getSystemService(Context.LAYOUT_IN FLATER_SERVICE);
43 Shell shellView = (Shell) inflater.inflate(R.layout.shell_view, null); 51 Shell shellView = (Shell) inflater.inflate(R.layout.shell_view, null);
44 52
45 removeAllViews(); 53 removeAllViews();
46 addView(shellView, new FrameLayout.LayoutParams( 54 addView(shellView, new FrameLayout.LayoutParams(
47 FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams. MATCH_PARENT)); 55 FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams. MATCH_PARENT));
48 mActiveShell = shellView; 56 mActiveShell = shellView;
49 57
50 return shellView; 58 return shellView;
51 } 59 }
52 60
53 private static native void nativeInit(Object shellManagerInstance); 61 private static native void nativeInit(Object shellManagerInstance);
62 private static native void nativeLaunchShell(String url);
54 } 63 }
OLDNEW
« no previous file with comments | « content/shell/android/java/src/org/chromium/content_shell/Shell.java ('k') | content/shell/android/shell_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698