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

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

Issue 831523005: Remove most native WebContents references from Java (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Kept same error checking behavior for aw_contents.cc Created 5 years, 11 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
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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 if (mLoading) { 279 if (mLoading) {
280 mStopReloadButton 280 mStopReloadButton
281 .setImageResource(android.R.drawable.ic_menu_close_clear_can cel); 281 .setImageResource(android.R.drawable.ic_menu_close_clear_can cel);
282 } else { 282 } else {
283 mStopReloadButton.setImageResource(R.drawable.ic_refresh); 283 mStopReloadButton.setImageResource(R.drawable.ic_refresh);
284 } 284 }
285 } 285 }
286 286
287 /** 287 /**
288 * Initializes the ContentView based on the native tab contents pointer pass ed in. 288 * Initializes the ContentView based on the native tab contents pointer pass ed in.
289 * @param nativeWebContents The pointer to the native tab contents object. 289 * @param webContents A {@link WebContents} object.
290 */ 290 */
291 @SuppressWarnings("unused") 291 @SuppressWarnings("unused")
292 @CalledByNative 292 @CalledByNative
293 private void initFromNativeTabContents(long nativeWebContents) { 293 private void initFromNativeTabContents(WebContents webContents) {
294 Context context = getContext(); 294 Context context = getContext();
295 mContentViewCore = new ContentViewCore(context); 295 mContentViewCore = new ContentViewCore(context);
296 ContentView cv = ContentView.newInstance(context, mContentViewCore); 296 ContentView cv = ContentView.newInstance(context, mContentViewCore);
297 mContentViewCore.initialize(cv, cv, nativeWebContents, mWindow); 297 mContentViewCore.initialize(cv, cv, webContents, mWindow);
298 mContentViewCore.setContentViewClient(mContentViewClient); 298 mContentViewCore.setContentViewClient(mContentViewClient);
299 mWebContents = mContentViewCore.getWebContents(); 299 mWebContents = mContentViewCore.getWebContents();
300 mNavigationController = mWebContents.getNavigationController(); 300 mNavigationController = mWebContents.getNavigationController();
301 if (getParent() != null) mContentViewCore.onShow(); 301 if (getParent() != null) mContentViewCore.onShow();
302 if (mWebContents.getUrl() != null) { 302 if (mWebContents.getUrl() != null) {
303 mUrlTextView.setText(mWebContents.getUrl()); 303 mUrlTextView.setText(mWebContents.getUrl());
304 } 304 }
305 ((FrameLayout) findViewById(R.id.contentview_holder)).addView(cv, 305 ((FrameLayout) findViewById(R.id.contentview_holder)).addView(cv,
306 new FrameLayout.LayoutParams( 306 new FrameLayout.LayoutParams(
307 FrameLayout.LayoutParams.MATCH_PARENT, 307 FrameLayout.LayoutParams.MATCH_PARENT,
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 Context.INPUT_METHOD_SERVICE); 348 Context.INPUT_METHOD_SERVICE);
349 if (visible) { 349 if (visible) {
350 imm.showSoftInput(mUrlTextView, InputMethodManager.SHOW_IMPLICIT); 350 imm.showSoftInput(mUrlTextView, InputMethodManager.SHOW_IMPLICIT);
351 } else { 351 } else {
352 imm.hideSoftInputFromWindow(mUrlTextView.getWindowToken(), 0); 352 imm.hideSoftInputFromWindow(mUrlTextView.getWindowToken(), 0);
353 } 353 }
354 } 354 }
355 355
356 private static native void nativeCloseShell(long shellPtr); 356 private static native void nativeCloseShell(long shellPtr);
357 } 357 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698