| 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 // Sends ChromeViewHostMsg_SearchBoxDeleteMostVisitedItem to the browser. | 102 // Sends ChromeViewHostMsg_SearchBoxDeleteMostVisitedItem to the browser. |
| 103 void DeleteMostVisitedItem(InstantRestrictedID most_visited_item_id); | 103 void DeleteMostVisitedItem(InstantRestrictedID most_visited_item_id); |
| 104 | 104 |
| 105 // Sends ChromeViewHostMsg_SearchBoxUndoMostVisitedDeletion to the browser. | 105 // Sends ChromeViewHostMsg_SearchBoxUndoMostVisitedDeletion to the browser. |
| 106 void UndoMostVisitedDeletion(InstantRestrictedID most_visited_item_id); | 106 void UndoMostVisitedDeletion(InstantRestrictedID most_visited_item_id); |
| 107 | 107 |
| 108 // Sends ChromeViewHostMsg_SearchBoxUndoAllMostVisitedDeletions to the | 108 // Sends ChromeViewHostMsg_SearchBoxUndoAllMostVisitedDeletions to the |
| 109 // browser. | 109 // browser. |
| 110 void UndoAllMostVisitedDeletions(); | 110 void UndoAllMostVisitedDeletions(); |
| 111 | 111 |
| 112 // Generates a data:// URL containing the HTML required to display a result. | |
| 113 bool GenerateDataURLForSuggestionRequest(const GURL& request_url, | |
| 114 GURL* data_url) const; | |
| 115 | |
| 116 // Sets the InstantAutocompleteResultStyle to the input value. | |
| 117 void SetInstantAutocompleteResultStyle( | |
| 118 const InstantAutocompleteResultStyle& style); | |
| 119 | |
| 120 // Formats a URL for display to the user. Strips out prefixes like whitespace, | |
| 121 // "http://" and "www." unless the user input (|query_|) matches the prefix. | |
| 122 // Also removes trailing whitespaces and "/" unless the user input matches the | |
| 123 // trailing "/". | |
| 124 void FormatURLForDisplay(string16* url) const; | |
| 125 | |
| 126 private: | 112 private: |
| 127 // Overridden from content::RenderViewObserver: | 113 // Overridden from content::RenderViewObserver: |
| 128 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 114 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 129 virtual void DidClearWindowObject(WebKit::WebFrame* frame) OVERRIDE; | 115 virtual void DidClearWindowObject(WebKit::WebFrame* frame) OVERRIDE; |
| 130 | 116 |
| 131 void OnChange(const string16& query, | 117 void OnChange(const string16& query, |
| 132 bool verbatim, | 118 bool verbatim, |
| 133 size_t selection_start, | 119 size_t selection_start, |
| 134 size_t selection_end); | 120 size_t selection_end); |
| 135 void OnSubmit(const string16& query); | 121 void OnSubmit(const string16& query); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 164 int start_margin_; | 150 int start_margin_; |
| 165 gfx::Rect popup_bounds_; | 151 gfx::Rect popup_bounds_; |
| 166 bool is_key_capture_enabled_; | 152 bool is_key_capture_enabled_; |
| 167 ThemeBackgroundInfo theme_info_; | 153 ThemeBackgroundInfo theme_info_; |
| 168 bool display_instant_results_; | 154 bool display_instant_results_; |
| 169 string16 omnibox_font_; | 155 string16 omnibox_font_; |
| 170 size_t omnibox_font_size_; | 156 size_t omnibox_font_size_; |
| 171 InstantRestrictedIDCache<InstantAutocompleteResult> | 157 InstantRestrictedIDCache<InstantAutocompleteResult> |
| 172 autocomplete_results_cache_; | 158 autocomplete_results_cache_; |
| 173 InstantRestrictedIDCache<InstantMostVisitedItem> most_visited_items_cache_; | 159 InstantRestrictedIDCache<InstantMostVisitedItem> most_visited_items_cache_; |
| 174 InstantAutocompleteResultStyle autocomplete_results_style_; | |
| 175 | 160 |
| 176 DISALLOW_COPY_AND_ASSIGN(SearchBox); | 161 DISALLOW_COPY_AND_ASSIGN(SearchBox); |
| 177 }; | 162 }; |
| 178 | 163 |
| 179 #endif // CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_ | 164 #endif // CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_ |
| OLD | NEW |