Chromium Code Reviews| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 43 | 43 |
| 44 // Sends ChromeViewHostMsg_StopCapturingKeyStrokes to the browser. | 44 // Sends ChromeViewHostMsg_StopCapturingKeyStrokes to the browser. |
| 45 void StopCapturingKeyStrokes(); | 45 void StopCapturingKeyStrokes(); |
| 46 | 46 |
| 47 // Sends ChromeViewHostMsg_SearchBoxNavigate to the browser. | 47 // Sends ChromeViewHostMsg_SearchBoxNavigate to the browser. |
| 48 void NavigateToURL(const GURL& url, | 48 void NavigateToURL(const GURL& url, |
| 49 content::PageTransition transition, | 49 content::PageTransition transition, |
| 50 WindowOpenDisposition disposition); | 50 WindowOpenDisposition disposition); |
| 51 | 51 |
| 52 // Sends ChromeViewHostMsg_InstantDeleteMostVisitedItem to the browser. | 52 // Sends ChromeViewHostMsg_InstantDeleteMostVisitedItem to the browser. |
| 53 void DeleteMostVisitedItem(int restrict_id); | 53 void DeleteMostVisitedItem(int most_visited_item_id); |
| 54 | 54 |
| 55 // Sends ChromeViewHostMsg_InstantUndoMostVisitedDeletion to the browser. | 55 // Sends ChromeViewHostMsg_InstantUndoMostVisitedDeletion to the browser. |
| 56 void UndoMostVisitedDeletion(int restrict_id); | 56 void UndoMostVisitedDeletion(int most_visited_item_id); |
| 57 | 57 |
| 58 // Sends ChromeViewHostMsg_InstantUndoAllMostVisitedDeletions to the browser. | 58 // Sends ChromeViewHostMsg_InstantUndoAllMostVisitedDeletions to the browser. |
| 59 void UndoAllMostVisitedDeletions(); | 59 void UndoAllMostVisitedDeletions(); |
| 60 | 60 |
| 61 const string16& query() const { return query_; } | 61 const string16& query() const { return query_; } |
| 62 bool verbatim() const { return verbatim_; } | 62 bool verbatim() const { return verbatim_; } |
| 63 size_t selection_start() const { return selection_start_; } | 63 size_t selection_start() const { return selection_start_; } |
| 64 size_t selection_end() const { return selection_end_; } | 64 size_t selection_end() const { return selection_end_; } |
| 65 int results_base() const { return results_base_; } | 65 int results_base() const { return results_base_; } |
| 66 bool is_key_capture_enabled() const { return is_key_capture_enabled_; } | 66 bool is_key_capture_enabled() const { return is_key_capture_enabled_; } |
| 67 bool display_instant_results() const { return display_instant_results_; } | 67 bool display_instant_results() const { return display_instant_results_; } |
| 68 const string16& omnibox_font() const { return omnibox_font_; } | 68 const string16& omnibox_font() const { return omnibox_font_; } |
| 69 size_t omnibox_font_size() const { return omnibox_font_size_; } | 69 size_t omnibox_font_size() const { return omnibox_font_size_; } |
| 70 | 70 |
| 71 // In extended Instant, returns the start-edge margin of the location bar in | 71 // In extended Instant, returns the start-edge margin of the location bar in |
| 72 // screen pixels. | 72 // screen pixels. |
| 73 int GetStartMargin() const; | 73 int GetStartMargin() const; |
| 74 | 74 |
| 75 // Returns the bounds of the omnibox popup in screen coordinates. | 75 // Returns the bounds of the omnibox popup in screen coordinates. |
| 76 gfx::Rect GetPopupBounds() const; | 76 gfx::Rect GetPopupBounds() const; |
| 77 | 77 |
| 78 const std::vector<InstantAutocompleteResult>& GetAutocompleteResults(); | 78 const std::vector<InstantAutocompleteResult>& GetAutocompleteResults(); |
| 79 // Searchbox retains ownership of this object. | 79 // Searchbox retains ownership of this object. |
| 80 const InstantAutocompleteResult* | 80 const InstantAutocompleteResult* |
| 81 GetAutocompleteResultWithId(size_t restricted_id) const; | 81 GetAutocompleteResultWithId(size_t autocomplete_result_id) const; |
| 82 const ThemeBackgroundInfo& GetThemeBackgroundInfo(); | 82 const ThemeBackgroundInfo& GetThemeBackgroundInfo(); |
| 83 | 83 |
| 84 // Most Visited items. | 84 // Most Visited items. |
| 85 const std::vector<MostVisitedItem>& GetMostVisitedItems(); | 85 const std::vector<MostVisitedItem>& GetMostVisitedItems(); |
| 86 | 86 |
| 87 // Secure Urls. | 87 // Secure Urls. IDs here are for Most Visited items. |
| 88 int UrlToRestrictedId(const string16 url); | 88 int UrlToRestrictedId(const string16 url); |
|
David Black
2013/03/11 21:19:30
Function names too, please! (They're more visible
sreeram
2013/03/11 21:42:00
Done.
| |
| 89 string16 RestrictedIdToURL(int id); | 89 string16 RestrictedIdToURL(int most_visited_item_id); |
| 90 string16 GenerateThumbnailUrl(int id); | 90 string16 GenerateThumbnailUrl(int most_visited_item_id); |
| 91 string16 GenerateFaviconUrl(int id); | 91 string16 GenerateFaviconUrl(int most_visited_item_id); |
| 92 | 92 |
| 93 private: | 93 private: |
| 94 // Overridden from content::RenderViewObserver: | 94 // Overridden from content::RenderViewObserver: |
| 95 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 95 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 96 virtual void DidClearWindowObject(WebKit::WebFrame* frame) OVERRIDE; | 96 virtual void DidClearWindowObject(WebKit::WebFrame* frame) OVERRIDE; |
| 97 | 97 |
| 98 void OnChange(const string16& query, | 98 void OnChange(const string16& query, |
| 99 bool verbatim, | 99 bool verbatim, |
| 100 size_t selection_start, | 100 size_t selection_start, |
| 101 size_t selection_end); | 101 size_t selection_end); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 133 std::vector<InstantAutocompleteResult> autocomplete_results_; | 133 std::vector<InstantAutocompleteResult> autocomplete_results_; |
| 134 size_t last_results_base_; | 134 size_t last_results_base_; |
| 135 std::vector<InstantAutocompleteResult> last_autocomplete_results_; | 135 std::vector<InstantAutocompleteResult> last_autocomplete_results_; |
| 136 bool is_key_capture_enabled_; | 136 bool is_key_capture_enabled_; |
| 137 ThemeBackgroundInfo theme_info_; | 137 ThemeBackgroundInfo theme_info_; |
| 138 bool display_instant_results_; | 138 bool display_instant_results_; |
| 139 string16 omnibox_font_; | 139 string16 omnibox_font_; |
| 140 size_t omnibox_font_size_; | 140 size_t omnibox_font_size_; |
| 141 std::vector<MostVisitedItem> most_visited_items_; | 141 std::vector<MostVisitedItem> most_visited_items_; |
| 142 | 142 |
| 143 // URL to Restricted Id mapping. | 143 // URL to Restricted Id mapping. IDs here are for Most Visited items. |
| 144 // TODO(dcblack): Unify this logic to work with both Most Visited and | 144 // TODO(dcblack): Unify this logic to work with both Most Visited and |
| 145 // history suggestions. (crbug/175768) | 145 // history suggestions. (crbug/175768) |
| 146 std::map<string16, int> url_to_restricted_id_map_; | 146 std::map<string16, int> url_to_most_visited_item_id_map_; |
| 147 std::map<int, string16> restricted_id_to_url_map_; | 147 std::map<int, string16> most_visited_item_id_to_url_map_; |
| 148 int last_restricted_id_; | 148 int last_most_visited_item_id_; |
| 149 | 149 |
| 150 DISALLOW_COPY_AND_ASSIGN(SearchBox); | 150 DISALLOW_COPY_AND_ASSIGN(SearchBox); |
| 151 }; | 151 }; |
| 152 | 152 |
| 153 #endif // CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_ | 153 #endif // CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_ |
| OLD | NEW |