| Index: chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellToolbar.java
|
| diff --git a/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellToolbar.java b/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellToolbar.java
|
| index a4fbf2d71cd3f5b1253d99aabcefe5e1fec1a21f..1161c24ace81062bf0d71cfcdedf436e396268df 100644
|
| --- a/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellToolbar.java
|
| +++ b/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellToolbar.java
|
| @@ -52,6 +52,9 @@ public class ChromeShellToolbar extends LinearLayout {
|
|
|
| private SuggestionPopup mSuggestionPopup;
|
|
|
| + private ImageButton mStopButton;
|
| + private ImageButton mReloadButton;
|
| +
|
| /**
|
| * @param context The Context the view is running in.
|
| * @param attrs The attributes of the XML tag that is inflating the view.
|
| @@ -87,7 +90,10 @@ public class ChromeShellToolbar extends LinearLayout {
|
| private void onLoadProgressChanged(int progress) {
|
| removeCallbacks(mClearProgressRunnable);
|
| mProgressDrawable.setLevel(100 * progress);
|
| - if (progress == 100) postDelayed(mClearProgressRunnable, COMPLETED_PROGRESS_TIMEOUT_MS);
|
| + boolean isLoading = progress != 100;
|
| + mStopButton.setVisibility(isLoading ? VISIBLE : GONE);
|
| + mReloadButton.setVisibility(isLoading ? GONE : VISIBLE);
|
| + if (!isLoading) postDelayed(mClearProgressRunnable, COMPLETED_PROGRESS_TIMEOUT_MS);
|
| }
|
|
|
| /**
|
| @@ -104,6 +110,7 @@ public class ChromeShellToolbar extends LinearLayout {
|
| mProgressDrawable = (ClipDrawable) findViewById(R.id.toolbar).getBackground();
|
| initializeUrlField();
|
| initializeMenuButton();
|
| + initializeStopReloadButton();
|
| }
|
|
|
| void setMenuHandler(AppMenuHandler menuHandler) {
|
| @@ -174,6 +181,23 @@ public class ChromeShellToolbar extends LinearLayout {
|
| });
|
| }
|
|
|
| + private void initializeStopReloadButton() {
|
| + mStopButton = (ImageButton)findViewById(R.id.stop);
|
| + mStopButton.setOnClickListener(new OnClickListener() {
|
| + @Override
|
| + public void onClick(View v) {
|
| + mTab.getContentViewCore().stopLoading();
|
| + }
|
| + });
|
| + mReloadButton = (ImageButton)findViewById(R.id.reload);
|
| + mReloadButton.setOnClickListener(new OnClickListener() {
|
| + @Override
|
| + public void onClick(View v) {
|
| + mTab.getContentViewCore().reload(true);
|
| + }
|
| + });
|
| + }
|
| +
|
| /**
|
| * @return Current tab that is shown by ChromeShell.
|
| */
|
|
|