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

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

Issue 165993008: Don't miss to call ContentView.onShow when lunching content shell and test shell (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 9 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
« no previous file with comments | « chrome/android/testshell/java/src/org/chromium/chrome/testshell/TabManager.java ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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.graphics.drawable.ClipDrawable; 8 import android.graphics.drawable.ClipDrawable;
9 import android.text.TextUtils; 9 import android.text.TextUtils;
10 import android.util.AttributeSet; 10 import android.util.AttributeSet;
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 245
246 /** 246 /**
247 * Initializes the ContentView based on the native tab contents pointer pass ed in. 247 * Initializes the ContentView based on the native tab contents pointer pass ed in.
248 * @param nativeTabContents The pointer to the native tab contents object. 248 * @param nativeTabContents The pointer to the native tab contents object.
249 */ 249 */
250 @SuppressWarnings("unused") 250 @SuppressWarnings("unused")
251 @CalledByNative 251 @CalledByNative
252 private void initFromNativeTabContents(long nativeTabContents) { 252 private void initFromNativeTabContents(long nativeTabContents) {
253 mContentView = ContentView.newInstance(getContext(), nativeTabContents, mWindow); 253 mContentView = ContentView.newInstance(getContext(), nativeTabContents, mWindow);
254 mContentView.setContentViewClient(mContentViewClient); 254 mContentView.setContentViewClient(mContentViewClient);
255 if (getParent() != null) mContentView.onShow();
255 if (mContentView.getUrl() != null) mUrlTextView.setText(mContentView.get Url()); 256 if (mContentView.getUrl() != null) mUrlTextView.setText(mContentView.get Url());
256 ((FrameLayout) findViewById(R.id.contentview_holder)).addView(mContentVi ew, 257 ((FrameLayout) findViewById(R.id.contentview_holder)).addView(mContentVi ew,
257 new FrameLayout.LayoutParams( 258 new FrameLayout.LayoutParams(
258 FrameLayout.LayoutParams.MATCH_PARENT, 259 FrameLayout.LayoutParams.MATCH_PARENT,
259 FrameLayout.LayoutParams.MATCH_PARENT)); 260 FrameLayout.LayoutParams.MATCH_PARENT));
260 mContentView.requestFocus(); 261 mContentView.requestFocus();
261 mContentViewRenderView.setCurrentContentView(mContentView); 262 mContentViewRenderView.setCurrentContentView(mContentView);
262 } 263 }
263 264
264 /** 265 /**
265 * @return The {@link ContentView} currently shown by this Shell. 266 * @return The {@link ContentView} currently shown by this Shell.
266 */ 267 */
267 public ContentView getContentView() { 268 public ContentView getContentView() {
268 return mContentView; 269 return mContentView;
269 } 270 }
270 271
271 private void setKeyboardVisibilityForUrl(boolean visible) { 272 private void setKeyboardVisibilityForUrl(boolean visible) {
272 InputMethodManager imm = (InputMethodManager) getContext().getSystemServ ice( 273 InputMethodManager imm = (InputMethodManager) getContext().getSystemServ ice(
273 Context.INPUT_METHOD_SERVICE); 274 Context.INPUT_METHOD_SERVICE);
274 if (visible) { 275 if (visible) {
275 imm.showSoftInput(mUrlTextView, InputMethodManager.SHOW_IMPLICIT); 276 imm.showSoftInput(mUrlTextView, InputMethodManager.SHOW_IMPLICIT);
276 } else { 277 } else {
277 imm.hideSoftInputFromWindow(mUrlTextView.getWindowToken(), 0); 278 imm.hideSoftInputFromWindow(mUrlTextView.getWindowToken(), 0);
278 } 279 }
279 } 280 }
280 281
281 private static native void nativeCloseShell(long shellPtr); 282 private static native void nativeCloseShell(long shellPtr);
282 } 283 }
OLDNEW
« no previous file with comments | « chrome/android/testshell/java/src/org/chromium/chrome/testshell/TabManager.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698