| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |