diff options
author | Michael Kolb <kolby@google.com> | 2010-09-27 16:22:38 -0700 |
---|---|---|
committer | Michael Kolb <kolby@google.com> | 2010-09-27 16:22:38 -0700 |
commit | 6e4653ee2adbee765d210e44ed38600d79135a06 (patch) | |
tree | 95d9ecd13e870d72b1bf0f66c0b5e1130f3d7b1d | |
parent | 21ce4d295802db811873b46e7821abfa0540dab2 (diff) | |
download | packages_apps_Browser-6e4653ee2adbee765d210e44ed38600d79135a06.zip packages_apps_Browser-6e4653ee2adbee765d210e44ed38600d79135a06.tar.gz packages_apps_Browser-6e4653ee2adbee765d210e44ed38600d79135a06.tar.bz2 |
increase max number of tabs
Change-Id: I45cd23442fc0d4d3d117f9eca6051b79169d9c0d
-rw-r--r-- | res/values/integers.xml | 2 | ||||
-rw-r--r-- | src/com/android/browser/TabControl.java | 13 |
2 files changed, 10 insertions, 5 deletions
diff --git a/res/values/integers.xml b/res/values/integers.xml index 0402e90..9aae216 100644 --- a/res/values/integers.xml +++ b/res/values/integers.xml @@ -16,4 +16,6 @@ <integer name="max_suggest_lines_landscape">6</integer> <!-- The number of lines in the suggestions dropdown in portrait --> <integer name="max_suggest_lines_portrait">12</integer> + <!-- The maximum number of open tabs --> + <integer name="max_tabs">16</integer> </resources>
\ No newline at end of file diff --git a/src/com/android/browser/TabControl.java b/src/com/android/browser/TabControl.java index d7435d7..e417a39 100644 --- a/src/com/android/browser/TabControl.java +++ b/src/com/android/browser/TabControl.java @@ -36,11 +36,11 @@ class TabControl { // Log Tag private static final String LOGTAG = "TabControl"; // Maximum number of tabs. - private static final int MAX_TABS = 8; + private int mMaxTabs; // Private array of WebViews that are used as tabs. - private ArrayList<Tab> mTabs = new ArrayList<Tab>(MAX_TABS); + private ArrayList<Tab> mTabs; // Queue of most recently viewed tabs. - private ArrayList<Tab> mTabQueue = new ArrayList<Tab>(MAX_TABS); + private ArrayList<Tab> mTabQueue; // Current position in mTabs. private int mCurrentTab = -1; // A private instance of BrowserActivity to interface with when adding and @@ -61,6 +61,9 @@ class TabControl { mActivity = activity; mThumbnailDir = activity.getDir("thumbnails", 0); mDisplayZoomControls = true; + mMaxTabs = activity.getResources().getInteger(R.integer.max_tabs); + mTabs = new ArrayList<Tab>(mMaxTabs); + mTabQueue = new ArrayList<Tab>(mMaxTabs); } File getThumbnailDir() { @@ -158,7 +161,7 @@ class TabControl { } boolean canCreateNewTab() { - return MAX_TABS != mTabs.size(); + return mMaxTabs != mTabs.size(); } /** @@ -183,7 +186,7 @@ class TabControl { boolean privateBrowsing) { int size = mTabs.size(); // Return false if we have maxed out on tabs - if (MAX_TABS == size) { + if (mMaxTabs == size) { return null; } final WebView w = createNewWebView(privateBrowsing); |