Chromium Code Reviews| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 56 private ImageButton mStopButton; | 56 private ImageButton mStopButton; |
| 57 private ImageButton mReloadButton; | 57 private ImageButton mReloadButton; |
| 58 | 58 |
| 59 private ClipDrawable mProgressDrawable; | 59 private ClipDrawable mProgressDrawable; |
| 60 | 60 |
| 61 private long mNativeShell; | 61 private long mNativeShell; |
| 62 private ContentViewRenderView mContentViewRenderView; | 62 private ContentViewRenderView mContentViewRenderView; |
| 63 private WindowAndroid mWindow; | 63 private WindowAndroid mWindow; |
| 64 | 64 |
| 65 private boolean mLoading = false; | 65 private boolean mLoading = false; |
| 66 private boolean mIsFullscreen = false; | |
| 66 | 67 |
| 67 /** | 68 /** |
| 68 * Constructor for inflating via XML. | 69 * Constructor for inflating via XML. |
| 69 */ | 70 */ |
| 70 public Shell(Context context, AttributeSet attrs) { | 71 public Shell(Context context, AttributeSet attrs) { |
| 71 super(context, attrs); | 72 super(context, attrs); |
| 72 } | 73 } |
| 73 | 74 |
| 74 /** | 75 /** |
| 75 * Set the SurfaceView being renderered to as soon as it is available. | 76 * Set the SurfaceView being renderered to as soon as it is available. |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 254 @SuppressWarnings("unused") | 255 @SuppressWarnings("unused") |
| 255 @CalledByNative | 256 @CalledByNative |
| 256 private void onLoadProgressChanged(double progress) { | 257 private void onLoadProgressChanged(double progress) { |
| 257 removeCallbacks(mClearProgressRunnable); | 258 removeCallbacks(mClearProgressRunnable); |
| 258 mProgressDrawable.setLevel((int) (10000.0 * progress)); | 259 mProgressDrawable.setLevel((int) (10000.0 * progress)); |
| 259 if (progress == 1.0) postDelayed(mClearProgressRunnable, COMPLETED_PROGR ESS_TIMEOUT_MS); | 260 if (progress == 1.0) postDelayed(mClearProgressRunnable, COMPLETED_PROGR ESS_TIMEOUT_MS); |
| 260 } | 261 } |
| 261 | 262 |
| 262 @CalledByNative | 263 @CalledByNative |
| 263 private void toggleFullscreenModeForTab(boolean enterFullscreen) { | 264 private void toggleFullscreenModeForTab(boolean enterFullscreen) { |
| 265 mIsFullscreen = enterFullscreen; | |
| 266 mWebContents.wasResized(); | |
|
Ted C
2014/10/02 21:52:45
Why is this necessary?
Could we just do:
mUrlText
qinmin
2014/10/02 22:44:30
Done. Set the whole toolbar's visibility to false
| |
| 264 } | 267 } |
| 265 | 268 |
| 266 @CalledByNative | 269 @CalledByNative |
| 267 private boolean isFullscreenForTabOrPending() { | 270 private boolean isFullscreenForTabOrPending() { |
| 268 return false; | 271 return mIsFullscreen; |
| 269 } | 272 } |
| 270 | 273 |
| 271 @SuppressWarnings("unused") | 274 @SuppressWarnings("unused") |
| 272 @CalledByNative | 275 @CalledByNative |
| 273 private void setIsLoading(boolean loading) { | 276 private void setIsLoading(boolean loading) { |
| 274 mLoading = loading; | 277 mLoading = loading; |
| 275 } | 278 } |
| 276 | 279 |
| 277 /** | 280 /** |
| 278 * Initializes the ContentView based on the native tab contents pointer pass ed in. | 281 * Initializes the ContentView based on the native tab contents pointer pass ed in. |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 335 Context.INPUT_METHOD_SERVICE); | 338 Context.INPUT_METHOD_SERVICE); |
| 336 if (visible) { | 339 if (visible) { |
| 337 imm.showSoftInput(mUrlTextView, InputMethodManager.SHOW_IMPLICIT); | 340 imm.showSoftInput(mUrlTextView, InputMethodManager.SHOW_IMPLICIT); |
| 338 } else { | 341 } else { |
| 339 imm.hideSoftInputFromWindow(mUrlTextView.getWindowToken(), 0); | 342 imm.hideSoftInputFromWindow(mUrlTextView.getWindowToken(), 0); |
| 340 } | 343 } |
| 341 } | 344 } |
| 342 | 345 |
| 343 private static native void nativeCloseShell(long shellPtr); | 346 private static native void nativeCloseShell(long shellPtr); |
| 344 } | 347 } |
| OLD | NEW |