Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1443)

Unified Diff: content/shell/android/java/src/org/chromium/content_shell/Shell.java

Issue 513183002: Adding option for Stop/Reload in location bar for content shell. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits resolved Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/shell/android/java/res/layout/shell_view.xml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..bc870ab889c8db0da759c3f1cb559d6a7bb66380 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,20 @@ 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();
+ }
+ });
+ mReloadButton = (ImageButton)findViewById(R.id.reload);
+ mReloadButton.setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ mContentViewCore.reload(true);
+ }
+ });
}
@SuppressWarnings("unused")
@@ -277,6 +293,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);
+ }
}
/**
« no previous file with comments | « content/shell/android/java/res/layout/shell_view.xml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698