Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2367)

Unified Diff: chrome/renderer/searchbox/searchbox.cc

Issue 14660022: Move most visited item state info from InstantController to InstantService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/searchbox/searchbox.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/searchbox/searchbox.cc
diff --git a/chrome/renderer/searchbox/searchbox.cc b/chrome/renderer/searchbox/searchbox.cc
index ef1f6abcf9af0d6964c085642a819af8856afe4d..4aa93c34843229e4c3e01c57c83285162c96ddc3 100644
--- a/chrome/renderer/searchbox/searchbox.cc
+++ b/chrome/renderer/searchbox/searchbox.cc
@@ -98,13 +98,15 @@ void SearchBox::NavigateToURL(const GURL& url,
void SearchBox::DeleteMostVisitedItem(
InstantRestrictedID most_visited_item_id) {
render_view()->Send(new ChromeViewHostMsg_SearchBoxDeleteMostVisitedItem(
- render_view()->GetRoutingID(), most_visited_item_id));
+ render_view()->GetRoutingID(),
+ GetURLForMostVisitedItem(most_visited_item_id)));
}
void SearchBox::UndoMostVisitedDeletion(
InstantRestrictedID most_visited_item_id) {
render_view()->Send(new ChromeViewHostMsg_SearchBoxUndoMostVisitedDeletion(
- render_view()->GetRoutingID(), most_visited_item_id));
+ render_view()->GetRoutingID(),
+ GetURLForMostVisitedItem(most_visited_item_id)));
}
void SearchBox::UndoAllMostVisitedDeletions() {
@@ -423,3 +425,8 @@ bool SearchBox::GetMostVisitedItemWithID(
return most_visited_items_cache_.GetItemWithRestrictedID(most_visited_item_id,
item);
}
+
+GURL SearchBox::GetURLForMostVisitedItem(InstantRestrictedID item_id) const {
+ InstantMostVisitedItem item;
+ return GetMostVisitedItemWithID(item_id, &item) ? item.url : GURL();
+}
« no previous file with comments | « chrome/renderer/searchbox/searchbox.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698