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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 | 280 |
281 /** | 281 /** |
282 * Initializes the ContentView based on the native tab contents pointer pass
ed in. | 282 * Initializes the ContentView based on the native tab contents pointer pass
ed in. |
283 * @param webContents A {@link WebContents} object. | 283 * @param webContents A {@link WebContents} object. |
284 */ | 284 */ |
285 @SuppressWarnings("unused") | 285 @SuppressWarnings("unused") |
286 @CalledByNative | 286 @CalledByNative |
287 private void initFromNativeTabContents(WebContents webContents) { | 287 private void initFromNativeTabContents(WebContents webContents) { |
288 Context context = getContext(); | 288 Context context = getContext(); |
289 mContentViewCore = new ContentViewCore(context); | 289 mContentViewCore = new ContentViewCore(context); |
290 ContentView cv = ContentView.newInstance(context, mContentViewCore); | 290 ContentView cv = new ContentView(context, mContentViewCore); |
291 mContentViewCore.initialize(cv, cv, webContents, mWindow); | 291 mContentViewCore.initialize(cv, cv, webContents, mWindow); |
292 mContentViewCore.setContentViewClient(mContentViewClient); | 292 mContentViewCore.setContentViewClient(mContentViewClient); |
293 mWebContents = mContentViewCore.getWebContents(); | 293 mWebContents = mContentViewCore.getWebContents(); |
294 mNavigationController = mWebContents.getNavigationController(); | 294 mNavigationController = mWebContents.getNavigationController(); |
295 if (getParent() != null) mContentViewCore.onShow(); | 295 if (getParent() != null) mContentViewCore.onShow(); |
296 if (mWebContents.getUrl() != null) { | 296 if (mWebContents.getUrl() != null) { |
297 mUrlTextView.setText(mWebContents.getUrl()); | 297 mUrlTextView.setText(mWebContents.getUrl()); |
298 } | 298 } |
299 ((FrameLayout) findViewById(R.id.contentview_holder)).addView(cv, | 299 ((FrameLayout) findViewById(R.id.contentview_holder)).addView(cv, |
300 new FrameLayout.LayoutParams( | 300 new FrameLayout.LayoutParams( |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 Context.INPUT_METHOD_SERVICE); | 345 Context.INPUT_METHOD_SERVICE); |
346 if (visible) { | 346 if (visible) { |
347 imm.showSoftInput(mUrlTextView, InputMethodManager.SHOW_IMPLICIT); | 347 imm.showSoftInput(mUrlTextView, InputMethodManager.SHOW_IMPLICIT); |
348 } else { | 348 } else { |
349 imm.hideSoftInputFromWindow(mUrlTextView.getWindowToken(), 0); | 349 imm.hideSoftInputFromWindow(mUrlTextView.getWindowToken(), 0); |
350 } | 350 } |
351 } | 351 } |
352 | 352 |
353 private static native void nativeCloseShell(long shellPtr); | 353 private static native void nativeCloseShell(long shellPtr); |
354 } | 354 } |
OLD | NEW |