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

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

Issue 12319108: Prevent querying of restricted query values. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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/resources/extensions/searchbox_api.js ('k') | chrome/renderer/searchbox/searchbox.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/searchbox/searchbox.h
diff --git a/chrome/renderer/searchbox/searchbox.h b/chrome/renderer/searchbox/searchbox.h
index 188272968fb55f1bfa87625474479ac5c5cce858..af5042fb464cbe958aae6d0ed0537fcb0716e387 100644
--- a/chrome/renderer/searchbox/searchbox.h
+++ b/chrome/renderer/searchbox/searchbox.h
@@ -28,8 +28,15 @@ class SearchBox : public content::RenderViewObserver,
virtual ~SearchBox();
// Sends ChromeViewHostMsg_SetSuggestions to the browser.
+ // If |suggestions| is non-empty and the first element in |suggestions| is of
+ // type INSTANT_COMPLETE_REPLACE then this method will also update the current
+ // query text.
void SetSuggestions(const std::vector<InstantSuggestion>& suggestions);
+ // Clears the current query text, used to ensure that restricted query strings
+ // are not retained.
+ void ClearQuery();
+
// Sends ChromeViewHostMsg_ShowInstantOverlay to the browser.
void ShowInstantOverlay(InstantShownReason reason,
int height,
@@ -135,6 +142,13 @@ class SearchBox : public content::RenderViewObserver,
size_t omnibox_font_size_;
std::vector<InstantMostVisitedItem> most_visited_items_;
+ // URL to Restricted Id mapping.
+ // TODO(dcblack): Unify this logic to work with both Most Visited and
+ // history suggestions. (crbug/175768)
+ std::map<string16, int> url_to_restricted_id_map_;
+ std::map<int, string16> restricted_id_to_url_map_;
+ int last_restricted_id_;
+
DISALLOW_COPY_AND_ASSIGN(SearchBox);
};
« no previous file with comments | « chrome/renderer/resources/extensions/searchbox_api.js ('k') | chrome/renderer/searchbox/searchbox.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698