summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--res/anim/find_dialog_enter.xml30
-rw-r--r--res/anim/find_dialog_exit.xml30
-rw-r--r--res/anim/title_bar_enter.xml (renamed from res/layout/tab_header.xml)21
-rw-r--r--res/anim/title_bar_exit.xml22
-rw-r--r--res/drawable-hdpi/background_titlebar.pngbin22547 -> 0 bytes
-rwxr-xr-xres/drawable-hdpi/browser_tab_selected.9.pngbin1048 -> 0 bytes
-rwxr-xr-xres/drawable-hdpi/browser_tab_unselected.9.pngbin450 -> 0 bytes
-rw-r--r--res/drawable-hdpi/ic_btn_bookmarks.pngbin0 -> 1309 bytes
-rw-r--r--res/drawable-hdpi/ic_new_window.pngbin2336 -> 0 bytes
-rw-r--r--res/drawable-hdpi/ic_titlebar_zoom.pngbin3048 -> 0 bytes
-rw-r--r--res/drawable-hdpi/ic_titlebar_zoom_out.pngbin2978 -> 0 bytes
-rwxr-xr-xres/drawable-hdpi/minitab_focus.9.pngbin355 -> 0 bytes
-rwxr-xr-xres/drawable-hdpi/minitab_press.9.pngbin425 -> 0 bytes
-rwxr-xr-xres/drawable-hdpi/minitab_selected.9.pngbin854 -> 0 bytes
-rwxr-xr-xres/drawable-hdpi/minitab_unselected.9.pngbin287 -> 0 bytes
-rwxr-xr-xres/drawable-hdpi/search.9.pngbin4441 -> 0 bytes
-rwxr-xr-xres/drawable-hdpi/tab_browser_selected.9.pngbin337 -> 0 bytes
-rwxr-xr-xres/drawable-hdpi/tab_browser_unselected.9.pngbin322 -> 0 bytes
-rwxr-xr-xres/drawable-hdpi/tab_selected.9.pngbin371 -> 0 bytes
-rwxr-xr-xres/drawable-hdpi/tab_unselected.9.pngbin267 -> 0 bytes
-rw-r--r--res/drawable-mdpi/background_titlebar.pngbin2426 -> 0 bytes
-rw-r--r--res/drawable-mdpi/browser_tab_selected.9.pngbin48595 -> 0 bytes
-rw-r--r--res/drawable-mdpi/browser_tab_unselected.9.pngbin50621 -> 0 bytes
-rw-r--r--res/drawable-mdpi/ic_btn_bookmarks.pngbin0 -> 809 bytes
-rw-r--r--res/drawable-mdpi/ic_new_window.pngbin3010 -> 0 bytes
-rw-r--r--res/drawable-mdpi/ic_titlebar_zoom.pngbin2143 -> 0 bytes
-rw-r--r--res/drawable-mdpi/ic_titlebar_zoom_out.pngbin2131 -> 0 bytes
-rw-r--r--res/drawable-mdpi/minitab_focus.9.pngbin47833 -> 0 bytes
-rw-r--r--res/drawable-mdpi/minitab_press.9.pngbin48225 -> 0 bytes
-rw-r--r--res/drawable-mdpi/minitab_selected.9.pngbin48121 -> 0 bytes
-rw-r--r--res/drawable-mdpi/minitab_unselected.9.pngbin47724 -> 0 bytes
-rw-r--r--res/drawable-mdpi/search.9.pngbin2054 -> 0 bytes
-rw-r--r--res/drawable-mdpi/tab_browser_selected.9.pngbin392 -> 0 bytes
-rw-r--r--res/drawable-mdpi/tab_browser_unselected.9.pngbin388 -> 0 bytes
-rw-r--r--res/drawable-mdpi/tab_selected.9.pngbin332 -> 0 bytes
-rw-r--r--res/drawable-mdpi/tab_unselected.9.pngbin287 -> 0 bytes
-rw-r--r--res/drawable/tab_indicator.xml42
-rw-r--r--res/layout/title_bar.xml2
-rw-r--r--res/values/arrays.xml33
-rw-r--r--res/values/strings.xml7
-rw-r--r--res/values/styles.xml5
-rw-r--r--src/com/android/browser/AddBookmarkPage.java110
-rw-r--r--src/com/android/browser/BrowserActivity.java5
-rw-r--r--src/com/android/browser/BrowserBookmarksAdapter.java4
-rwxr-xr-xsrc/com/android/browser/GeolocationPermissionsPrompt.java2
45 files changed, 148 insertions, 165 deletions
diff --git a/res/anim/find_dialog_enter.xml b/res/anim/find_dialog_enter.xml
index 6e19c21..5e597a4 100644
--- a/res/anim/find_dialog_enter.xml
+++ b/res/anim/find_dialog_enter.xml
@@ -1,21 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
-<!--
-/* //device/apps/common/res/anim/options_panel_enter.xml
-**
-** Copyright 2007, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
+<!-- Copyright (C) 2007 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
-->
<set xmlns:android="http://schemas.android.com/apk/res/android"
diff --git a/res/anim/find_dialog_exit.xml b/res/anim/find_dialog_exit.xml
index 5775bab..854abd0 100644
--- a/res/anim/find_dialog_exit.xml
+++ b/res/anim/find_dialog_exit.xml
@@ -1,21 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
-<!--
-/* //device/apps/common/res/anim/options_panel_exit.xml
-**
-** Copyright 2007, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
+<!-- Copyright (C) 2007 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
-->
<set xmlns:android="http://schemas.android.com/apk/res/android"
diff --git a/res/layout/tab_header.xml b/res/anim/title_bar_enter.xml
index 7187034..ce4df1d 100644
--- a/res/layout/tab_header.xml
+++ b/res/anim/title_bar_enter.xml
@@ -14,17 +14,10 @@
limitations under the License.
-->
-<FrameLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:background="@drawable/tab_indicator"
- >
- <TextView
- android:id="@+id/tab_label"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:textColor="?android:attr/textColorPrimary"
- android:layout_gravity="center"
- />
-</FrameLayout>
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ android:interpolator="@android:anim/decelerate_interpolator">
+ <translate android:fromYDelta="-25%" android:toYDelta="0"
+ android:duration="@android:integer/config_shortAnimTime"/>
+ <alpha android:fromAlpha="0.0" android:toAlpha="1.0"
+ android:duration="@android:integer/config_shortAnimTime" />
+</set>
diff --git a/res/anim/title_bar_exit.xml b/res/anim/title_bar_exit.xml
new file mode 100644
index 0000000..b56710c
--- /dev/null
+++ b/res/anim/title_bar_exit.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ android:interpolator="@android:anim/accelerate_interpolator">
+ <translate android:fromYDelta="0" android:toYDelta="-50%"
+ android:duration="@android:integer/config_shortAnimTime"/>
+ <alpha android:fromAlpha="1.0" android:toAlpha="0.0"
+ android:duration="@android:integer/config_shortAnimTime" />
+</set>
diff --git a/res/drawable-hdpi/background_titlebar.png b/res/drawable-hdpi/background_titlebar.png
deleted file mode 100644
index 8271454..0000000
--- a/res/drawable-hdpi/background_titlebar.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/browser_tab_selected.9.png b/res/drawable-hdpi/browser_tab_selected.9.png
deleted file mode 100755
index cc1086b..0000000
--- a/res/drawable-hdpi/browser_tab_selected.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/browser_tab_unselected.9.png b/res/drawable-hdpi/browser_tab_unselected.9.png
deleted file mode 100755
index a5e7087..0000000
--- a/res/drawable-hdpi/browser_tab_unselected.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_btn_bookmarks.png b/res/drawable-hdpi/ic_btn_bookmarks.png
new file mode 100644
index 0000000..f656a9a
--- /dev/null
+++ b/res/drawable-hdpi/ic_btn_bookmarks.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_new_window.png b/res/drawable-hdpi/ic_new_window.png
deleted file mode 100644
index 0eaea9b..0000000
--- a/res/drawable-hdpi/ic_new_window.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_titlebar_zoom.png b/res/drawable-hdpi/ic_titlebar_zoom.png
deleted file mode 100644
index f6cb83a..0000000
--- a/res/drawable-hdpi/ic_titlebar_zoom.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_titlebar_zoom_out.png b/res/drawable-hdpi/ic_titlebar_zoom_out.png
deleted file mode 100644
index 60dde08..0000000
--- a/res/drawable-hdpi/ic_titlebar_zoom_out.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/minitab_focus.9.png b/res/drawable-hdpi/minitab_focus.9.png
deleted file mode 100755
index 3ea2540..0000000
--- a/res/drawable-hdpi/minitab_focus.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/minitab_press.9.png b/res/drawable-hdpi/minitab_press.9.png
deleted file mode 100755
index 5de769d..0000000
--- a/res/drawable-hdpi/minitab_press.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/minitab_selected.9.png b/res/drawable-hdpi/minitab_selected.9.png
deleted file mode 100755
index 05f1a3c..0000000
--- a/res/drawable-hdpi/minitab_selected.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/minitab_unselected.9.png b/res/drawable-hdpi/minitab_unselected.9.png
deleted file mode 100755
index ac6b7f8..0000000
--- a/res/drawable-hdpi/minitab_unselected.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/search.9.png b/res/drawable-hdpi/search.9.png
deleted file mode 100755
index a152fa0..0000000
--- a/res/drawable-hdpi/search.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/tab_browser_selected.9.png b/res/drawable-hdpi/tab_browser_selected.9.png
deleted file mode 100755
index 379ffe0..0000000
--- a/res/drawable-hdpi/tab_browser_selected.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/tab_browser_unselected.9.png b/res/drawable-hdpi/tab_browser_unselected.9.png
deleted file mode 100755
index bc37346..0000000
--- a/res/drawable-hdpi/tab_browser_unselected.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/tab_selected.9.png b/res/drawable-hdpi/tab_selected.9.png
deleted file mode 100755
index 76ca8ae..0000000
--- a/res/drawable-hdpi/tab_selected.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/tab_unselected.9.png b/res/drawable-hdpi/tab_unselected.9.png
deleted file mode 100755
index e1dce20..0000000
--- a/res/drawable-hdpi/tab_unselected.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/background_titlebar.png b/res/drawable-mdpi/background_titlebar.png
deleted file mode 100644
index 1fdb078..0000000
--- a/res/drawable-mdpi/background_titlebar.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/browser_tab_selected.9.png b/res/drawable-mdpi/browser_tab_selected.9.png
deleted file mode 100644
index f822528..0000000
--- a/res/drawable-mdpi/browser_tab_selected.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/browser_tab_unselected.9.png b/res/drawable-mdpi/browser_tab_unselected.9.png
deleted file mode 100644
index 6f6e373..0000000
--- a/res/drawable-mdpi/browser_tab_unselected.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_btn_bookmarks.png b/res/drawable-mdpi/ic_btn_bookmarks.png
new file mode 100644
index 0000000..a4981be
--- /dev/null
+++ b/res/drawable-mdpi/ic_btn_bookmarks.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_new_window.png b/res/drawable-mdpi/ic_new_window.png
deleted file mode 100644
index 3f8442d..0000000
--- a/res/drawable-mdpi/ic_new_window.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_titlebar_zoom.png b/res/drawable-mdpi/ic_titlebar_zoom.png
deleted file mode 100644
index b497dab..0000000
--- a/res/drawable-mdpi/ic_titlebar_zoom.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_titlebar_zoom_out.png b/res/drawable-mdpi/ic_titlebar_zoom_out.png
deleted file mode 100644
index 4b5a3dd..0000000
--- a/res/drawable-mdpi/ic_titlebar_zoom_out.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/minitab_focus.9.png b/res/drawable-mdpi/minitab_focus.9.png
deleted file mode 100644
index 7c290e3..0000000
--- a/res/drawable-mdpi/minitab_focus.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/minitab_press.9.png b/res/drawable-mdpi/minitab_press.9.png
deleted file mode 100644
index c7369e7..0000000
--- a/res/drawable-mdpi/minitab_press.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/minitab_selected.9.png b/res/drawable-mdpi/minitab_selected.9.png
deleted file mode 100644
index 849e124..0000000
--- a/res/drawable-mdpi/minitab_selected.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/minitab_unselected.9.png b/res/drawable-mdpi/minitab_unselected.9.png
deleted file mode 100644
index e12b36d..0000000
--- a/res/drawable-mdpi/minitab_unselected.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/search.9.png b/res/drawable-mdpi/search.9.png
deleted file mode 100644
index 037e8f0..0000000
--- a/res/drawable-mdpi/search.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/tab_browser_selected.9.png b/res/drawable-mdpi/tab_browser_selected.9.png
deleted file mode 100644
index 40ad080..0000000
--- a/res/drawable-mdpi/tab_browser_selected.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/tab_browser_unselected.9.png b/res/drawable-mdpi/tab_browser_unselected.9.png
deleted file mode 100644
index 9b5ec0e..0000000
--- a/res/drawable-mdpi/tab_browser_unselected.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/tab_selected.9.png b/res/drawable-mdpi/tab_selected.9.png
deleted file mode 100644
index a47f024..0000000
--- a/res/drawable-mdpi/tab_selected.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/tab_unselected.9.png b/res/drawable-mdpi/tab_unselected.9.png
deleted file mode 100644
index 2e3a454..0000000
--- a/res/drawable-mdpi/tab_unselected.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable/tab_indicator.xml b/res/drawable/tab_indicator.xml
deleted file mode 100644
index 839532b..0000000
--- a/res/drawable/tab_indicator.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item
- android:state_selected="true"
- android:state_focused="false"
- android:state_pressed="false"
- android:drawable="@drawable/minitab_selected"
- />
- <item
- android:state_selected="false"
- android:state_focused="false"
- android:state_pressed="false"
- android:drawable="@drawable/minitab_unselected"
- />
- <item
- android:state_focused="true"
- android:state_selected="true"
- android:state_pressed="false"
- android:drawable="@drawable/minitab_focus"
- />
- <item
- android:state_pressed="true"
- android:state_selected="true"
- android:state_focused="true"
- android:drawable="@drawable/minitab_press"
- />
-</selector>
diff --git a/res/layout/title_bar.xml b/res/layout/title_bar.xml
index 422458f..b9bc136 100644
--- a/res/layout/title_bar.xml
+++ b/res/layout/title_bar.xml
@@ -79,7 +79,7 @@
android:scaleType="center"
android:layout_marginBottom="4dip"
android:background="@drawable/btn_bookmark"
- android:src="@drawable/ic_tab_bookmarks_unselected"
+ android:src="@drawable/ic_btn_bookmarks"
/>
</LinearLayout>
</LinearLayout>
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
deleted file mode 100644
index 219cc6b..0000000
--- a/res/values/arrays.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- -->
-<resources>
- <string-array name="webstorage_quota_entries">
- <item>No quota allowed</item>
- <item>5 MB</item>
- <item>10 MB</item>
- <item>30 MB</item>
- <item>100 MB</item>
- </string-array>
- <string-array name="webstorage_quota_entries_values">
- <item>0</item>
- <item>5</item>
- <item>10</item>
- <item>30</item>
- <item>100</item>
- </string-array>
-</resources>
-
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 2d91d31..86468f1 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -158,6 +158,8 @@
<string name="set_as_homepage">Set as homepage</string>
<!-- Toast informing the user that their action to save a bookmark has succeeded -->
<string name="bookmark_saved">Saved to bookmarks.</string>
+ <!-- Toast informing the user that their action to save a bookmark did not succeed -->
+ <string name="bookmark_not_saved">Unable to save bookmark.</string>
<!-- Toast confirming that the homepage has been set -->
<string name="homepage_set">Homepage set.</string>
<!-- Error that appears in the title of Bookmark dialog when user selects OK with empty Name field -->
@@ -514,9 +516,6 @@
<!-- Verb placed in front of a screenshot of a web page that, when clicked,
will add that page to bookmarks -->
<string name="add_bookmark_short">Add</string>
- <!-- Add bookmark dialog sets its title to this if we have no database.
- This is an error case -->
- <string name="no_database">No database!</string>
<!-- This string is for the browser "Go To" UI. -->
<!-- Do not translate. This string is not displayed in UI (no badge is selected for go to). -->
@@ -674,7 +673,7 @@
<item>eBay</item>
<item>http://www.ebay.com/</item>
<item>CNN</item>
- <item>http://www.cnn.com/</item>
+ <item>http://www.cnn.com/index.html</item>
<item>NY Times</item>
<item>http://www.nytimes.com/</item>
<item>ESPN</item>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 89d5a04..21ab98f 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -45,5 +45,10 @@
<item name="android:windowEnterAnimation">@anim/find_dialog_enter</item>
<item name="android:windowExitAnimation">@anim/find_dialog_exit</item>
</style>
+
+ <style name="TitleBar">
+ <item name="android:windowEnterAnimation">@anim/title_bar_enter</item>
+ <item name="android:windowExitAnimation">@anim/title_bar_exit</item>
+ </style>
</resources>
diff --git a/src/com/android/browser/AddBookmarkPage.java b/src/com/android/browser/AddBookmarkPage.java
index 71bf481..0ded526 100644
--- a/src/com/android/browser/AddBookmarkPage.java
+++ b/src/com/android/browser/AddBookmarkPage.java
@@ -25,6 +25,8 @@ import android.graphics.Bitmap;
import android.net.ParseException;
import android.net.WebAddress;
import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
import android.provider.Browser;
import android.view.View;
import android.view.Window;
@@ -50,12 +52,15 @@ public class AddBookmarkPage extends Activity {
private Bitmap mThumbnail;
private String mOriginalUrl;
+ // Message IDs
+ private static final int SAVE_BOOKMARK = 100;
+
+ private Handler mHandler;
+
private View.OnClickListener mSaveBookmark = new View.OnClickListener() {
public void onClick(View v) {
if (save()) {
finish();
- Toast.makeText(AddBookmarkPage.this, R.string.bookmark_saved,
- Toast.LENGTH_LONG).show();
}
}
};
@@ -94,7 +99,6 @@ public class AddBookmarkPage extends Activity {
mAddress = (EditText) findViewById(R.id.address);
mAddress.setText(url);
-
View.OnClickListener accept = mSaveBookmark;
mButton = (TextView) findViewById(R.id.OK);
mButton.setOnClickListener(accept);
@@ -106,13 +110,59 @@ public class AddBookmarkPage extends Activity {
mButton.requestFocus();
}
}
-
+
+ private void createHandler() {
+ if (mHandler == null) {
+ mHandler = new Handler() {
+ @Override
+ public void handleMessage(Message msg) {
+ switch (msg.what) {
+ case SAVE_BOOKMARK:
+ // Unbundle bookmark data.
+ Bundle bundle = msg.getData();
+ String title = bundle.getString("title");
+ String url = bundle.getString("url");
+ boolean invalidateThumbnail = bundle.getBoolean("invalidateThumbnail");
+ Bitmap thumbnail = invalidateThumbnail
+ ? null : (Bitmap) bundle.getParcelable("thumbnail");
+ String touchIconUrl = bundle.getString("touchIconUrl");
+
+ // Save to the bookmarks DB.
+ if (updateBookmarksDB(title, url, thumbnail, touchIconUrl)) {
+ Toast.makeText(AddBookmarkPage.this, R.string.bookmark_saved,
+ Toast.LENGTH_LONG).show();
+ } else {
+ Toast.makeText(AddBookmarkPage.this, R.string.bookmark_not_saved,
+ Toast.LENGTH_LONG).show();
+ }
+ break;
+ }
+ }
+ };
+ }
+ }
+
+ private boolean updateBookmarksDB(String title, String url, Bitmap thumbnail, String touchIconUrl) {
+ try {
+ final ContentResolver cr = getContentResolver();
+ Bookmarks.addBookmark(null, cr, url, title, thumbnail, true);
+ if (touchIconUrl != null) {
+ final Cursor c =
+ BrowserBookmarksAdapter.queryBookmarksForUrl(cr, null, url, true);
+ new DownloadTouchIcon(cr, c, url).execute(mTouchIconUrl);
+ }
+ } catch (IllegalStateException e) {
+ return false;
+ }
+ return true;
+ }
+
/**
- * Save the data to the database.
- * Also, change the view to dialog stating
- * that the webpage has been saved.
+ * Parse the data entered in the dialog and post a message to update the bookmarks database.
*/
boolean save() {
+ createHandler();
+
String title = mTitle.getText().toString().trim();
String unfilteredUrl =
BrowserActivity.fixUrl(mAddress.getText().toString());
@@ -150,33 +200,25 @@ public class AddBookmarkPage extends Activity {
mAddress.setError(r.getText(R.string.bookmark_url_not_valid));
return false;
}
- try {
- if (mEditingExisting) {
- mMap.putString("title", title);
- mMap.putString("url", url);
- setResult(RESULT_OK, (new Intent()).setAction(
- getIntent().toString()).putExtras(mMap));
- } else {
- final ContentResolver cr = getContentResolver();
-
- // Only use mThumbnail if url and mOriginalUrl are matches.
- // Otherwise the user edited the url and the thumbnail no longer applies.
- if (url.equals(mOriginalUrl)) {
- Bookmarks.addBookmark(null, cr, url, title, mThumbnail, true);
- } else {
- Bookmarks.addBookmark(null, cr, url, title, null, true);
- }
- if (mTouchIconUrl != null) {
- final Cursor c =
- BrowserBookmarksAdapter.queryBookmarksForUrl(
- cr, null, url, true);
- new DownloadTouchIcon(cr, c, url).execute(mTouchIconUrl);
- }
- setResult(RESULT_OK);
- }
- } catch (IllegalStateException e) {
- setTitle(r.getText(R.string.no_database));
- return false;
+
+ if (mEditingExisting) {
+ mMap.putString("title", title);
+ mMap.putString("url", url);
+ mMap.putBoolean("invalidateThumbnail", !url.equals(mOriginalUrl));
+ setResult(RESULT_OK, (new Intent()).setAction(
+ getIntent().toString()).putExtras(mMap));
+ } else {
+ // Post a message to write to the DB.
+ Bundle bundle = new Bundle();
+ bundle.putString("title", title);
+ bundle.putString("url", url);
+ bundle.putParcelable("thumbnail", mThumbnail);
+ bundle.putBoolean("invalidateThumbnail", !url.equals(mOriginalUrl));
+ bundle.putString("touchIconUrl", mTouchIconUrl);
+ Message msg = Message.obtain(mHandler, SAVE_BOOKMARK);
+ msg.setData(bundle);
+ mHandler.sendMessage(msg);
+ setResult(RESULT_OK);
}
return true;
}
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java
index 1954dad..1e7361b 100644
--- a/src/com/android/browser/BrowserActivity.java
+++ b/src/com/android/browser/BrowserActivity.java
@@ -1021,8 +1021,7 @@ public class BrowserActivity extends Activity
params.gravity = Gravity.TOP;
WebView mainView = mTabControl.getCurrentWebView();
boolean atTop = mainView != null && mainView.getScrollY() == 0;
- params.windowAnimations = atTop ? 0
- : com.android.internal.R.style.Animation_DropDownDown;
+ params.windowAnimations = atTop ? 0 : R.style.TitleBar;
// XXX : Without providing an offset, the fake title bar will be
// placed underneath the status bar. Use the global visible rect
// of mBrowserFrameLayout to determine the bottom of the status bar
@@ -1063,7 +1062,7 @@ public class BrowserActivity extends Activity
// fake title bar was displayed. Make sure it has the appropriate
// animation/lack thereof before removing.
params.windowAnimations = mainView != null && mainView.getScrollY() == 0
- ? 0 : com.android.internal.R.style.Animation_DropDownDown;
+ ? 0 : R.style.TitleBar;
WindowManager manager
= (WindowManager) getSystemService(Context.WINDOW_SERVICE);
manager.updateViewLayout(mFakeTitleBarHolder, params);
diff --git a/src/com/android/browser/BrowserBookmarksAdapter.java b/src/com/android/browser/BrowserBookmarksAdapter.java
index 8b0fb41..dd56d2f 100644
--- a/src/com/android/browser/BrowserBookmarksAdapter.java
+++ b/src/com/android/browser/BrowserBookmarksAdapter.java
@@ -170,6 +170,10 @@ class BrowserBookmarksAdapter extends BaseAdapter {
getString(Browser.HISTORY_PROJECTION_URL_INDEX))) {
values.put(Browser.BookmarkColumns.URL, url);
}
+
+ if (map.getBoolean("invalidateThumbnail") == true) {
+ values.put(Browser.BookmarkColumns.THUMBNAIL, new byte[0]);
+ }
if (values.size() > 0
&& mContentResolver.update(Browser.BOOKMARKS_URI, values,
"_id = " + id, null) != -1) {
diff --git a/src/com/android/browser/GeolocationPermissionsPrompt.java b/src/com/android/browser/GeolocationPermissionsPrompt.java
index 61005d5..a21bc3e 100755
--- a/src/com/android/browser/GeolocationPermissionsPrompt.java
+++ b/src/com/android/browser/GeolocationPermissionsPrompt.java
@@ -64,6 +64,8 @@ public class GeolocationPermissionsPrompt extends LinearLayout {
mCallback = callback;
Uri uri = Uri.parse(mOrigin);
setMessage("http".equals(uri.getScheme()) ? mOrigin.substring(7) : mOrigin);
+ // The checkbox should always be intially checked.
+ mRemember.setChecked(true);
showDialog(true);
}