| OLD | NEW |
| 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 Loading... |
| 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 // |most_visited_item_id|. If the |most_visited_item_id| is valid, returns |
| 119 // true and fills in |url|. If the |most_visited_item_id| is invalid, returns |
| 120 // false and |url| is not set. |
| 121 bool GenerateThumbnailURLFromRID(InstantRestrictedID most_visited_item_id, |
| 122 GURL* url) const; |
| 123 |
| 124 // Generates the favicon URL of the most visited item specified by the |
| 125 // |most_visited_item_id|. If the |most_visited_item_id| is valid, returns |
| 126 // true and fills in |url|. If the |most_visited_item_id| is invalid, returns |
| 127 // false and |url| is not set. |
| 128 bool GenerateFaviconURLFromRID(InstantRestrictedID most_visited_item_id, |
| 129 GURL* url) const; |
| 130 |
| 117 private: | 131 private: |
| 118 // Overridden from content::RenderViewObserver: | 132 // Overridden from content::RenderViewObserver: |
| 119 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 133 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 120 | 134 |
| 121 void OnChange(const string16& query, | 135 void OnChange(const string16& query, |
| 122 bool verbatim, | 136 bool verbatim, |
| 123 size_t selection_start, | 137 size_t selection_start, |
| 124 size_t selection_end); | 138 size_t selection_end); |
| 125 void OnSubmit(const string16& query); | 139 void OnSubmit(const string16& query); |
| 126 void OnCancel(const string16& query); | 140 void OnCancel(const string16& query); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 137 size_t selection_start, | 151 size_t selection_start, |
| 138 size_t selection_end); | 152 size_t selection_end); |
| 139 void OnFocusChanged(OmniboxFocusState new_focus_state, | 153 void OnFocusChanged(OmniboxFocusState new_focus_state, |
| 140 OmniboxFocusChangeReason reason); | 154 OmniboxFocusChangeReason reason); |
| 141 void OnSetDisplayInstantResults(bool display_instant_results); | 155 void OnSetDisplayInstantResults(bool display_instant_results); |
| 142 void OnThemeChanged(const ThemeBackgroundInfo& theme_info); | 156 void OnThemeChanged(const ThemeBackgroundInfo& theme_info); |
| 143 void OnThemeAreaHeightChanged(int height); | 157 void OnThemeAreaHeightChanged(int height); |
| 144 void OnFontInformationReceived(const string16& omnibox_font, | 158 void OnFontInformationReceived(const string16& omnibox_font, |
| 145 size_t omnibox_font_size); | 159 size_t omnibox_font_size); |
| 146 void OnMostVisitedChanged( | 160 void OnMostVisitedChanged( |
| 147 const std::vector<InstantMostVisitedItemIDPair>& items); | 161 const std::vector<InstantMostVisitedItem>& items); |
| 148 | 162 |
| 149 // Returns the current zoom factor of the render view or 1 on failure. | 163 // Returns the current zoom factor of the render view or 1 on failure. |
| 150 double GetZoom() const; | 164 double GetZoom() const; |
| 151 | 165 |
| 152 // Sets the searchbox values to their initial value. | 166 // Sets the searchbox values to their initial value. |
| 153 void Reset(); | 167 void Reset(); |
| 154 | 168 |
| 155 // Sets the query to a new value. | 169 // Sets the query to a new value. |
| 156 void SetQuery(const string16& query, bool verbatim); | 170 void SetQuery(const string16& query, bool verbatim); |
| 157 | 171 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 172 string16 omnibox_font_; | 186 string16 omnibox_font_; |
| 173 size_t omnibox_font_size_; | 187 size_t omnibox_font_size_; |
| 174 InstantRestrictedIDCache<InstantAutocompleteResult> | 188 InstantRestrictedIDCache<InstantAutocompleteResult> |
| 175 autocomplete_results_cache_; | 189 autocomplete_results_cache_; |
| 176 InstantRestrictedIDCache<InstantMostVisitedItem> most_visited_items_cache_; | 190 InstantRestrictedIDCache<InstantMostVisitedItem> most_visited_items_cache_; |
| 177 | 191 |
| 178 DISALLOW_COPY_AND_ASSIGN(SearchBox); | 192 DISALLOW_COPY_AND_ASSIGN(SearchBox); |
| 179 }; | 193 }; |
| 180 | 194 |
| 181 #endif // CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_ | 195 #endif // CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_ |
| OLD | NEW |