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

Unified Diff: chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellToolbar.java

Issue 683203006: Adding option for adding new tab in tab manager for chrome shell. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comment changes Created 6 years, 1 month 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
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 4e0eefd4949e0a2160783c0a733b1296f320e75a..f666d1fc7eb0b7f01fe1a162cf805682c6169638 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
@@ -73,6 +73,7 @@ public class ChromeShellToolbar extends LinearLayout {
private SuggestionPopup mSuggestionPopup;
private ImageButton mStopReloadButton;
+ private ImageButton mAddButton;
private int mProgress = 0;
private boolean mLoading = true;
@@ -144,6 +145,7 @@ public class ChromeShellToolbar extends LinearLayout {
initializeTabSwitcherButton();
initializeMenuButton();
initializeStopReloadButton();
+ initializeAddButton();
}
void setMenuHandler(AppMenuHandler menuHandler) {
@@ -247,6 +249,25 @@ public class ChromeShellToolbar extends LinearLayout {
});
}
+ private void initializeAddButton() {
+ mAddButton = (ImageButton) findViewById(R.id.add_button);
+ mAddButton.setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ mTabManager.createNewTab();
+ }
+ });
+ }
+
+ /**
+ * Shows the add button and hides the stop/reload button.
Bernhard Bauer 2014/11/12 10:00:13 Technically, this can also do the opposite... Add
divya.bansal 2014/11/12 10:18:04 Done.
+ * @param visibility The visibility status of the tab switcher.
Bernhard Bauer 2014/11/12 10:00:13 Replace "tab switcher" with "add button".
divya.bansal 2014/11/12 10:18:04 Done.
+ */
+ public void showAddButton(boolean visibility) {
+ mAddButton.setVisibility(visibility ? VISIBLE : GONE);
+ mStopReloadButton.setVisibility(visibility ? GONE : VISIBLE);
+ }
+
/**
* @return Current tab that is shown by ChromeShell.
*/

Powered by Google App Engine
This is Rietveld 408576698