diff options
author | Leon Scroggins <scroggo@google.com> | 2009-05-28 17:27:38 -0400 |
---|---|---|
committer | Leon Scroggins <scroggo@google.com> | 2009-05-28 17:27:38 -0400 |
commit | feb941d4be5daaf439f6b463f423618caee15892 (patch) | |
tree | 11bc56f8f70cf3ba6f8be57b4a6422097bb10b24 /src/com/android | |
parent | 7bfa63b55644fbf2da1fe6a24b3be0267529202c (diff) | |
download | packages_apps_Browser-feb941d4be5daaf439f6b463f423618caee15892.zip packages_apps_Browser-feb941d4be5daaf439f6b463f423618caee15892.tar.gz packages_apps_Browser-feb941d4be5daaf439f6b463f423618caee15892.tar.bz2 |
Enable setting home page from bookmarks/history.
Fix for issue 1482954: Longpress on bookmark or history should set homepage
[1/1]. Add a string for set homepage. Add the option in both the context menu
for the browser history and for browser bookmarks. In BrowserHistoryPage and
BrowserBookmarksPage handle the new option by setting the new homepage.
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/browser/BrowserBookmarksPage.java | 9 | ||||
-rw-r--r-- | src/com/android/browser/BrowserHistoryPage.java | 6 |
2 files changed, 14 insertions, 1 deletions
diff --git a/src/com/android/browser/BrowserBookmarksPage.java b/src/com/android/browser/BrowserBookmarksPage.java index dd34c14..45fca87 100644 --- a/src/com/android/browser/BrowserBookmarksPage.java +++ b/src/com/android/browser/BrowserBookmarksPage.java @@ -44,6 +44,7 @@ import android.view.ViewGroup; import android.view.ContextMenu.ContextMenuInfo; import android.widget.AdapterView; import android.widget.ListView; +import android.widget.Toast; /** * View showing the user's bookmarks in the browser. @@ -107,7 +108,13 @@ public class BrowserBookmarksPage extends Activity implements break; case R.id.copy_url_context_menu_id: copy(getUrl(i.position)); - + break; + case R.id.homepage_context_menu_id: + BrowserSettings.getInstance().setHomePage(this, + getUrl(i.position)); + Toast.makeText(this, R.string.homepage_set, + Toast.LENGTH_LONG).show(); + break; default: return super.onContextItemSelected(item); } diff --git a/src/com/android/browser/BrowserHistoryPage.java b/src/com/android/browser/BrowserHistoryPage.java index 2b781a1..e333416 100644 --- a/src/com/android/browser/BrowserHistoryPage.java +++ b/src/com/android/browser/BrowserHistoryPage.java @@ -49,6 +49,7 @@ import android.widget.ExpandableListAdapter; import android.widget.ExpandableListView; import android.widget.ExpandableListView.ExpandableListContextMenuInfo; import android.widget.TextView; +import android.widget.Toast; import java.util.List; import java.util.Vector; @@ -222,6 +223,11 @@ public class BrowserHistoryPage extends ExpandableListActivity { Browser.deleteFromHistory(getContentResolver(), url); mAdapter.refreshData(); return true; + case R.id.homepage_context_menu_id: + BrowserSettings.getInstance().setHomePage(this, url); + Toast.makeText(this, R.string.homepage_set, + Toast.LENGTH_LONG).show(); + return true; default: break; } |