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..23f2de1efda465e9668cabf477ca3f112e114965 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,21 @@ 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(); |
+ } |
+ }); |
+ } |
+ |
+ public void showAddButton(boolean tabSwitcherStatus) { |
Bernhard Bauer
2014/11/11 09:08:22
Please add a Javadoc comment.
divya.bansal
2014/11/11 09:29:51
Done.
|
+ mAddButton.setVisibility(tabSwitcherStatus ? VISIBLE : GONE); |
+ mStopReloadButton.setVisibility(tabSwitcherStatus ? GONE : VISIBLE); |
+ } |
+ |
/** |
* @return Current tab that is shown by ChromeShell. |
*/ |