summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Scott <phanna@android.com>2009-07-14 10:49:22 -0400
committerPatrick Scott <phanna@android.com>2009-07-14 10:53:30 -0400
commitb0e4fc7b8efc66b20cf83a8d5f8dc9110d67da4f (patch)
tree710f62ce2b9875648e62d0e9d1771bf400c9c3f3
parent14ab4478b0805629686a33a14621a5e68692f6d3 (diff)
downloadpackages_apps_Browser-b0e4fc7b8efc66b20cf83a8d5f8dc9110d67da4f.tar.gz
packages_apps_Browser-b0e4fc7b8efc66b20cf83a8d5f8dc9110d67da4f.tar.bz2
packages_apps_Browser-b0e4fc7b8efc66b20cf83a8d5f8dc9110d67da4f.zip
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.
-rw-r--r--src/com/android/browser/BrowserActivity.java12
-rw-r--r--src/com/android/browser/TabControl.java5
2 files changed, 16 insertions, 1 deletions
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java
index 30c8c3d40..43f1acd00 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 bdb57fa91..274598a6a 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;
}