From b0e4fc7b8efc66b20cf83a8d5f8dc9110d67da4f Mon Sep 17 00:00:00 2001 From: Patrick Scott Date: Tue, 14 Jul 2009 10:49:22 -0400 Subject: Show the new tab when creating it from the bookmarks/history. When we are in the tab picker and a new tab is created from bookmarks/history, show the new tab in the picker and then animate to it. Only do this for the "open tabs in background" setting since openTab() will show the tab if that setting is false. We animate to the new tab because we currently don't have a way to show the new tab in the tab picker with updated picker data (title and url in particular). So instead of showing a blank tab, animate to the tab. Once the animations have been redesigned and the code refactored, this will hopefully get better. --- src/com/android/browser/BrowserActivity.java | 12 +++++++++++- src/com/android/browser/TabControl.java | 5 +++++ 2 files changed, 16 insertions(+), 1 deletion(-) (limited to 'src/com') diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java index 30c8c3d..43f1acd 100644 --- a/src/com/android/browser/BrowserActivity.java +++ b/src/com/android/browser/BrowserActivity.java @@ -4514,7 +4514,17 @@ public class BrowserActivity extends Activity String data = intent.getAction(); Bundle extras = intent.getExtras(); if (extras != null && extras.getBoolean("new_window", false)) { - openTab(data); + final TabControl.Tab newTab = openTab(data); + if (mSettings.openInBackground() && + newTab != null && mTabOverview != null) { + mTabControl.populatePickerData(newTab); + mTabControl.setCurrentTab(newTab); + mTabOverview.add(newTab); + mTabOverview.setCurrentIndex( + mTabControl.getCurrentIndex()); + sendAnimateFromOverview(newTab, false, + EMPTY_URL_DATA, TAB_OVERVIEW_DELAY, null); + } } else { final TabControl.Tab currentTab = mTabControl.getCurrentTab(); diff --git a/src/com/android/browser/TabControl.java b/src/com/android/browser/TabControl.java index bdb57fa..274598a 100644 --- a/src/com/android/browser/TabControl.java +++ b/src/com/android/browser/TabControl.java @@ -1066,6 +1066,11 @@ class TabControl { data.mScale = w.getScale(); data.mScrollX = w.getScrollX(); data.mScrollY = w.getScrollY(); + + // Remember the old picture if possible. + if (t.mPickerData != null) { + data.mPicture = t.mPickerData.mPicture; + } t.mPickerData = data; } -- cgit v1.1