summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/webui/history_ui.cc
diff options
context:
space:
mode:
authordubroy@chromium.org <dubroy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-05 14:11:14 +0000
committerdubroy@chromium.org <dubroy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-05 14:11:14 +0000
commit60a83db2ba3f8a4f071aca123d7df7deb607468e (patch)
tree1b1ba2b50c28c5a932167cefafe7bb16ffaa9a0b /chrome/browser/ui/webui/history_ui.cc
parentb0b10df891d60ebaacf5dbb0350eeca2f6d35e3c (diff)
downloadchromium_src-60a83db2ba3f8a4f071aca123d7df7deb607468e.zip
chromium_src-60a83db2ba3f8a4f071aca123d7df7deb607468e.tar.gz
chromium_src-60a83db2ba3f8a4f071aca123d7df7deb607468e.tar.bz2
History Tab: Un-bookmarking the page on clicking star icon.
BUG=115383 TEST=As described in the bug. Review URL: https://chromiumcodereview.appspot.com/9965057 Patch from Sanjoy Pal <ncj674@motorola.com>. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130914 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/webui/history_ui.cc')
-rw-r--r--chrome/browser/ui/webui/history_ui.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/chrome/browser/ui/webui/history_ui.cc b/chrome/browser/ui/webui/history_ui.cc
index 8b8e872..5735fe5 100644
--- a/chrome/browser/ui/webui/history_ui.cc
+++ b/chrome/browser/ui/webui/history_ui.cc
@@ -19,6 +19,7 @@
#include "base/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
+#include "chrome/browser/bookmarks/bookmark_utils.h"
#include "chrome/browser/history/history_notifications.h"
#include "chrome/browser/history/history_types.h"
#include "chrome/browser/profiles/profile.h"
@@ -174,6 +175,9 @@ void BrowsingHistoryHandler::RegisterMessages() {
web_ui()->RegisterMessageCallback("clearBrowsingData",
base::Bind(&BrowsingHistoryHandler::HandleClearBrowsingData,
base::Unretained(this)));
+ web_ui()->RegisterMessageCallback("removeBookmark",
+ base::Bind(&BrowsingHistoryHandler::HandleRemoveBookmark,
+ base::Unretained(this)));
}
void BrowsingHistoryHandler::HandleGetHistory(const ListValue* args) {
@@ -285,6 +289,13 @@ void BrowsingHistoryHandler::HandleClearBrowsingData(const ListValue* args) {
#endif
}
+void BrowsingHistoryHandler::HandleRemoveBookmark(const ListValue* args) {
+ string16 url = ExtractStringValue(args);
+ Profile* profile = Profile::FromWebUI(web_ui());
+ BookmarkModel* model = profile->GetBookmarkModel();
+ bookmark_utils::RemoveAllBookmarks(model, GURL(url));
+}
+
void BrowsingHistoryHandler::QueryComplete(
HistoryService::Handle request_handle,
history::QueryResults* results) {