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

Side by Side Diff: chrome/renderer/searchbox/searchbox.h

Issue 15907006: Rip out browser-side RID caching for most visited items. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 7 years, 6 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 // Sends ChromeViewHostMsg_SearchBoxDeleteMostVisitedItem to the browser. 107 // Sends ChromeViewHostMsg_SearchBoxDeleteMostVisitedItem to the browser.
108 void DeleteMostVisitedItem(InstantRestrictedID most_visited_item_id); 108 void DeleteMostVisitedItem(InstantRestrictedID most_visited_item_id);
109 109
110 // Sends ChromeViewHostMsg_SearchBoxUndoMostVisitedDeletion to the browser. 110 // Sends ChromeViewHostMsg_SearchBoxUndoMostVisitedDeletion to the browser.
111 void UndoMostVisitedDeletion(InstantRestrictedID most_visited_item_id); 111 void UndoMostVisitedDeletion(InstantRestrictedID most_visited_item_id);
112 112
113 // Sends ChromeViewHostMsg_SearchBoxUndoAllMostVisitedDeletions to the 113 // Sends ChromeViewHostMsg_SearchBoxUndoAllMostVisitedDeletions to the
114 // browser. 114 // browser.
115 void UndoAllMostVisitedDeletions(); 115 void UndoAllMostVisitedDeletions();
116 116
117 // Generates the thumbnail URL of the most visited item specified by the
118 // |transient_url|. If the |transient_url| is valid, returns true and fills in
119 // |url|. If the |transient_url| is invalid, returns false and |url| is not
120 // set.
121 //
122 // Valid form of |transient_url|:
123 // chrome-search://thumb/<render_view_id>/<most_visited_item_id>
124 bool GenerateThumbnailURLFromTransientURL(const GURL& transient_url,
125 GURL* url) const;
126
127 // Generates the favicon URL of the most visited item specified by the
128 // |transient_url|. If the |transient_url| is valid, returns true and fills in
129 // |url|. If the |transient_url| is invalid, returns false and |url| is not
130 // set.
131 //
132 // Valid form of |transient_url|:
133 // chrome-search://favicon/<render_view_id>/<most_visited_item_id>
134 bool GenerateFaviconURLFromTransientURL(const GURL& transient_url,
135 GURL* url) const;
136
117 private: 137 private:
118 // Overridden from content::RenderViewObserver: 138 // Overridden from content::RenderViewObserver:
119 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 139 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
120 140
121 void OnChange(const string16& query, 141 void OnChange(const string16& query,
122 bool verbatim, 142 bool verbatim,
123 size_t selection_start, 143 size_t selection_start,
124 size_t selection_end); 144 size_t selection_end);
125 void OnSubmit(const string16& query); 145 void OnSubmit(const string16& query);
126 void OnCancel(const string16& query); 146 void OnCancel(const string16& query);
(...skipping 10 matching lines...) Expand all
137 size_t selection_start, 157 size_t selection_start,
138 size_t selection_end); 158 size_t selection_end);
139 void OnFocusChanged(OmniboxFocusState new_focus_state, 159 void OnFocusChanged(OmniboxFocusState new_focus_state,
140 OmniboxFocusChangeReason reason); 160 OmniboxFocusChangeReason reason);
141 void OnSetDisplayInstantResults(bool display_instant_results); 161 void OnSetDisplayInstantResults(bool display_instant_results);
142 void OnThemeChanged(const ThemeBackgroundInfo& theme_info); 162 void OnThemeChanged(const ThemeBackgroundInfo& theme_info);
143 void OnThemeAreaHeightChanged(int height); 163 void OnThemeAreaHeightChanged(int height);
144 void OnFontInformationReceived(const string16& omnibox_font, 164 void OnFontInformationReceived(const string16& omnibox_font,
145 size_t omnibox_font_size); 165 size_t omnibox_font_size);
146 void OnMostVisitedChanged( 166 void OnMostVisitedChanged(
147 const std::vector<InstantMostVisitedItemIDPair>& items); 167 const std::vector<InstantMostVisitedItem>& items);
148 168
149 // Returns the current zoom factor of the render view or 1 on failure. 169 // Returns the current zoom factor of the render view or 1 on failure.
150 double GetZoom() const; 170 double GetZoom() const;
151 171
152 // Sets the searchbox values to their initial value. 172 // Sets the searchbox values to their initial value.
153 void Reset(); 173 void Reset();
154 174
155 // Sets the query to a new value. 175 // Sets the query to a new value.
156 void SetQuery(const string16& query, bool verbatim); 176 void SetQuery(const string16& query, bool verbatim);
157 177
(...skipping 14 matching lines...) Expand all
172 string16 omnibox_font_; 192 string16 omnibox_font_;
173 size_t omnibox_font_size_; 193 size_t omnibox_font_size_;
174 InstantRestrictedIDCache<InstantAutocompleteResult> 194 InstantRestrictedIDCache<InstantAutocompleteResult>
175 autocomplete_results_cache_; 195 autocomplete_results_cache_;
176 InstantRestrictedIDCache<InstantMostVisitedItem> most_visited_items_cache_; 196 InstantRestrictedIDCache<InstantMostVisitedItem> most_visited_items_cache_;
177 197
178 DISALLOW_COPY_AND_ASSIGN(SearchBox); 198 DISALLOW_COPY_AND_ASSIGN(SearchBox);
179 }; 199 };
180 200
181 #endif // CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_ 201 #endif // CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698