Add "Save to bookmarks" to browser context menu.
Change-Id: I32f0364c0cad246c7f84c55c348eec629f5f0211
diff --git a/res/menu/browsercontext.xml b/res/menu/browsercontext.xml
index c8f827f..f3116c6 100755
--- a/res/menu/browsercontext.xml
+++ b/res/menu/browsercontext.xml
@@ -4,9 +4,9 @@
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.
@@ -43,7 +43,9 @@
<item android:id="@+id/save_link_context_menu_id"
android:title="@string/contextmenu_savelink"/>
<item android:id="@+id/copy_link_context_menu_id"
- android:title="@string/contextmenu_copylink"/>
+ android:title="@string/contextmenu_copylink"/>
+ <item android:id="@+id/save_link_bookmark_context_menu_id"
+ android:title="@string/save_to_bookmarks"/>
</group>
<group android:id="@+id/IMAGE_MENU">
<item android:id="@+id/download_context_menu_id"
@@ -62,4 +64,4 @@
android:title="@string/my_navigation_delete_label"/>
</group>
</menu>
-
+
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java
index 473845e..c4c9669 100644
--- a/src/com/android/browser/Controller.java
+++ b/src/com/android/browser/Controller.java
@@ -571,6 +571,9 @@
mActivity, url, view.getSettings().getUserAgentString(),
null, null, null, view.isPrivateBrowsingEnabled(), 0);
break;
+ case R.id.save_link_bookmark_context_menu_id:
+ bookmarkCurrentPage();
+ break;
}
break;
}
@@ -2247,6 +2250,7 @@
// -- Browser context menu
case R.id.open_context_menu_id:
case R.id.save_link_context_menu_id:
+ case R.id.save_link_bookmark_context_menu_id:
case R.id.copy_link_context_menu_id:
final WebView webView = getCurrentTopWebView();
if (null == webView) {