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

Side by Side 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: Remove query_state_ from SearchBox. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_ 5 #ifndef CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_
6 #define CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_ 6 #define CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 10 matching lines...) Expand all
21 class RenderView; 21 class RenderView;
22 } 22 }
23 23
24 class SearchBox : public content::RenderViewObserver, 24 class SearchBox : public content::RenderViewObserver,
25 public content::RenderViewObserverTracker<SearchBox> { 25 public content::RenderViewObserverTracker<SearchBox> {
26 public: 26 public:
27 explicit SearchBox(content::RenderView* render_view); 27 explicit SearchBox(content::RenderView* render_view);
28 virtual ~SearchBox(); 28 virtual ~SearchBox();
29 29
30 // Sends ChromeViewHostMsg_SetSuggestions to the browser. 30 // Sends ChromeViewHostMsg_SetSuggestions to the browser.
31 // If |suggestions| is non-empty and the first element in |suggestions| is of
32 // type INSTANT_COMPLETE_REPLACE then this method will also update the current
33 // query text.
31 void SetSuggestions(const std::vector<InstantSuggestion>& suggestions); 34 void SetSuggestions(const std::vector<InstantSuggestion>& suggestions);
32 35
36 // Clears the current query text, used to ensure that restricted query strings
37 // are not retained.
38 void ClearQuery();
39
33 // Sends ChromeViewHostMsg_ShowInstantOverlay to the browser. 40 // Sends ChromeViewHostMsg_ShowInstantOverlay to the browser.
34 void ShowInstantOverlay(InstantShownReason reason, 41 void ShowInstantOverlay(InstantShownReason reason,
35 int height, 42 int height,
36 InstantSizeUnits units); 43 InstantSizeUnits units);
37 44
38 // Sends ChromeViewHostMsg_StartCapturingKeyStrokes to the browser. 45 // Sends ChromeViewHostMsg_StartCapturingKeyStrokes to the browser.
39 void StartCapturingKeyStrokes(); 46 void StartCapturingKeyStrokes();
40 47
41 // Sends ChromeViewHostMsg_StopCapturingKeyStrokes to the browser. 48 // Sends ChromeViewHostMsg_StopCapturingKeyStrokes to the browser.
42 void StopCapturingKeyStrokes(); 49 void StopCapturingKeyStrokes();
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 // TODO(dcblack): Unify this logic to work with both Most Visited and 147 // TODO(dcblack): Unify this logic to work with both Most Visited and
141 // history suggestions. (crbug/175768) 148 // history suggestions. (crbug/175768)
142 std::map<string16, int> url_to_restricted_id_map_; 149 std::map<string16, int> url_to_restricted_id_map_;
143 std::map<int, string16> restricted_id_to_url_map_; 150 std::map<int, string16> restricted_id_to_url_map_;
144 int last_restricted_id_; 151 int last_restricted_id_;
145 152
146 DISALLOW_COPY_AND_ASSIGN(SearchBox); 153 DISALLOW_COPY_AND_ASSIGN(SearchBox);
147 }; 154 };
148 155
149 #endif // CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_ 156 #endif // CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698