Chromium Code Reviews| Index: content/shell/android/java/src/org/chromium/content_shell/Shell.java |
| diff --git a/content/shell/android/java/src/org/chromium/content_shell/Shell.java b/content/shell/android/java/src/org/chromium/content_shell/Shell.java |
| index 2b63bc0273f7b3d3d7eb7982adbfc9fae9e3f297..a1bab099dd1622d74bc68272176cc68119d8ffad 100644 |
| --- a/content/shell/android/java/src/org/chromium/content_shell/Shell.java |
| +++ b/content/shell/android/java/src/org/chromium/content_shell/Shell.java |
| @@ -49,6 +49,8 @@ public class Shell extends LinearLayout { |
| private EditText mUrlTextView; |
| private ImageButton mPrevButton; |
| private ImageButton mNextButton; |
| + private ImageButton mStopButton; |
| + private ImageButton mReloadButton; |
| private ClipDrawable mProgressDrawable; |
| @@ -213,6 +215,21 @@ public class Shell extends LinearLayout { |
| if (mContentViewCore.canGoForward()) mContentViewCore.goForward(); |
| } |
| }); |
| + mStopButton = (ImageButton)findViewById(R.id.stop); |
| + mStopButton.setOnClickListener(new OnClickListener() { |
| + @Override |
| + public void onClick(View v) { |
| + if (mLoading) |
| + mContentViewCore.stopLoading(); |
|
Ted C
2014/08/28 16:21:13
in java, braces are required unless the statement
|
| + } |
| + }); |
| + mReloadButton = (ImageButton)findViewById(R.id.reload); |
| + mReloadButton.setOnClickListener(new OnClickListener() { |
| + @Override |
| + public void onClick(View v) { |
| + mContentViewCore.reload(true); |
| + } |
| + }); |
| } |
| @SuppressWarnings("unused") |
| @@ -277,6 +294,10 @@ public class Shell extends LinearLayout { |
| private void enableUiControl(int controlId, boolean enabled) { |
| if (controlId == 0) mPrevButton.setEnabled(enabled); |
| else if (controlId == 1) mNextButton.setEnabled(enabled); |
| + else if (controlId == 2) { |
| + mStopButton.setVisibility(enabled ? VISIBLE : GONE); |
| + mReloadButton.setVisibility(enabled ? GONE : VISIBLE); |
| + } |
| } |
| /** |