Chromium Code Reviews| 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 3341991646752f023c18c72d74343cc3da814e1b..8e0c2fcdb9eee7b9e0fda3e155fe99db6002f8cd 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 |
| @@ -72,6 +72,8 @@ public class ChromeShellToolbar extends LinearLayout { |
| private SuggestionPopup mSuggestionPopup; |
| private ImageButton mStopReloadButton; |
| + private ImageButton mAddButton; |
| + |
| private int mProgress = 0; |
| private boolean mLoading = true; |
| @@ -99,6 +101,8 @@ public class ChromeShellToolbar extends LinearLayout { |
| public void showTab(ChromeShellTab tab) { |
| if (mTab != null) mTab.removeObserver(mTabObserver); |
| + mAddButton.setVisibility(GONE); |
|
Bernhard Bauer
2014/11/04 12:22:10
So, are we not going to show the stop/reload butto
divya.bansal
2014/11/05 09:04:22
Done. Showing the add button when tabswitcher is s
|
| + |
| mTab = tab; |
| if (mTab != null) { |
| @@ -143,6 +147,7 @@ public class ChromeShellToolbar extends LinearLayout { |
| initializeTabSwitcherButton(); |
| initializeMenuButton(); |
| initializeStopReloadButton(); |
| + initializeAddButton(); |
| } |
| void setMenuHandler(AppMenuHandler menuHandler) { |
| @@ -206,6 +211,9 @@ public class ChromeShellToolbar extends LinearLayout { |
| @Override |
| public void onClick(View v) { |
| if (mTabManager != null) mTabManager.toggleTabSwitcher(); |
| + mAddButton.setVisibility(mTabManager.isTabSwitcherVisible() ? VISIBLE : GONE); |
| + mStopReloadButton.setVisibility(mTabManager.isTabSwitcherVisible() |
| + ? GONE : VISIBLE); |
| } |
| }); |
| } |
| @@ -242,6 +250,16 @@ 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(); |
| + } |
| + }); |
| + } |
| + |
| /** |
| * @return Current tab that is shown by ChromeShell. |
| */ |