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 1161c24ace81062bf0d71cfcdedf436e396268df..ed9e570f8a0b2b6f8b3f85da2c98e0e685ad4cbd 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,8 +52,8 @@ public class ChromeShellToolbar extends LinearLayout { |
private SuggestionPopup mSuggestionPopup; |
- private ImageButton mStopButton; |
- private ImageButton mReloadButton; |
+ private ImageButton mStopReloadButton; |
+ private boolean mLoading = true; |
/** |
* @param context The Context the view is running in. |
@@ -90,10 +90,13 @@ public class ChromeShellToolbar extends LinearLayout { |
private void onLoadProgressChanged(int progress) { |
removeCallbacks(mClearProgressRunnable); |
mProgressDrawable.setLevel(100 * progress); |
- boolean isLoading = progress != 100; |
- mStopButton.setVisibility(isLoading ? VISIBLE : GONE); |
- mReloadButton.setVisibility(isLoading ? GONE : VISIBLE); |
- if (!isLoading) postDelayed(mClearProgressRunnable, COMPLETED_PROGRESS_TIMEOUT_MS); |
+ mLoading = progress != 100; |
+ if (mLoading) { |
+ mStopReloadButton.setImageResource(R.drawable.btn_stop_normal); |
+ } else { |
+ mStopReloadButton.setImageResource(R.drawable.btn_reload_normal); |
+ postDelayed(mClearProgressRunnable, COMPLETED_PROGRESS_TIMEOUT_MS); |
+ } |
} |
/** |
@@ -182,18 +185,15 @@ public class ChromeShellToolbar extends LinearLayout { |
} |
private void initializeStopReloadButton() { |
- mStopButton = (ImageButton)findViewById(R.id.stop); |
- mStopButton.setOnClickListener(new OnClickListener() { |
+ mStopReloadButton = (ImageButton)findViewById(R.id.stop_reload_button); |
+ mStopReloadButton.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); |
+ if (mLoading) { |
+ mTab.getContentViewCore().stopLoading(); |
+ } else { |
+ mTab.getContentViewCore().reload(true); |
+ } |
} |
}); |
} |