summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authorLeon Scroggins <scroggo@google.com>2009-05-28 17:27:38 -0400
committerLeon Scroggins <scroggo@google.com>2009-05-28 17:27:38 -0400
commitfeb941d4be5daaf439f6b463f423618caee15892 (patch)
tree11bc56f8f70cf3ba6f8be57b4a6422097bb10b24 /src/com/android
parent7bfa63b55644fbf2da1fe6a24b3be0267529202c (diff)
downloadpackages_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.java9
-rw-r--r--src/com/android/browser/BrowserHistoryPage.java6
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;
}