| 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 <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 | 117 |
| 118 // Sends UndoAllMostVisitedDeletions to the browser. | 118 // Sends UndoAllMostVisitedDeletions to the browser. |
| 119 void UndoAllMostVisitedDeletions(); | 119 void UndoAllMostVisitedDeletions(); |
| 120 | 120 |
| 121 // Sends UndoMostVisitedDeletion to the browser. | 121 // Sends UndoMostVisitedDeletion to the browser. |
| 122 void UndoMostVisitedDeletion(InstantRestrictedID most_visited_item_id); | 122 void UndoMostVisitedDeletion(InstantRestrictedID most_visited_item_id); |
| 123 | 123 |
| 124 bool is_focused() const { return is_focused_; } | 124 bool is_focused() const { return is_focused_; } |
| 125 bool is_input_in_progress() const { return is_input_in_progress_; } | 125 bool is_input_in_progress() const { return is_input_in_progress_; } |
| 126 bool is_key_capture_enabled() const { return is_key_capture_enabled_; } | 126 bool is_key_capture_enabled() const { return is_key_capture_enabled_; } |
| 127 const base::string16& query() const { return query_; } | |
| 128 const InstantSuggestion& suggestion() const { return suggestion_; } | 127 const InstantSuggestion& suggestion() const { return suggestion_; } |
| 129 | 128 |
| 130 private: | 129 private: |
| 131 // Overridden from content::RenderFrameObserver: | 130 // Overridden from content::RenderFrameObserver: |
| 132 void OnDestruct() override; | 131 void OnDestruct() override; |
| 133 | 132 |
| 134 // Overridden from chrome::mojom::SearchBox: | 133 // Overridden from chrome::mojom::SearchBox: |
| 135 void SetPageSequenceNumber(int page_seq_no) override; | 134 void SetPageSequenceNumber(int page_seq_no) override; |
| 136 void ChromeIdentityCheckResult(const base::string16& identity, | 135 void ChromeIdentityCheckResult(const base::string16& identity, |
| 137 bool identity_match) override; | 136 bool identity_match) override; |
| 138 void FocusChanged(OmniboxFocusState new_focus_state, | 137 void FocusChanged(OmniboxFocusState new_focus_state, |
| 139 OmniboxFocusChangeReason reason) override; | 138 OmniboxFocusChangeReason reason) override; |
| 140 void HistorySyncCheckResult(bool sync_history) override; | 139 void HistorySyncCheckResult(bool sync_history) override; |
| 141 void MostVisitedChanged( | 140 void MostVisitedChanged( |
| 142 const std::vector<InstantMostVisitedItem>& items) override; | 141 const std::vector<InstantMostVisitedItem>& items) override; |
| 143 void SetInputInProgress(bool input_in_progress) override; | 142 void SetInputInProgress(bool input_in_progress) override; |
| 144 void SetSuggestionToPrefetch(const InstantSuggestion& suggestion) override; | 143 void SetSuggestionToPrefetch(const InstantSuggestion& suggestion) override; |
| 145 void Submit(const base::string16& query, | 144 void Submit(const EmbeddedSearchRequestParams& params) override; |
| 146 const EmbeddedSearchRequestParams& params) override; | |
| 147 void ThemeChanged(const ThemeBackgroundInfo& theme_info) override; | 145 void ThemeChanged(const ThemeBackgroundInfo& theme_info) override; |
| 148 | 146 |
| 149 // Returns the current zoom factor of the render view or 1 on failure. | 147 // Returns the current zoom factor of the render view or 1 on failure. |
| 150 double GetZoom() const; | 148 double GetZoom() const; |
| 151 | 149 |
| 152 // Sets the searchbox values to their initial value. | 150 // Sets the searchbox values to their initial value. |
| 153 void Reset(); | 151 void Reset(); |
| 154 | 152 |
| 155 // Returns the URL of the Most Visited item specified by the |item_id|. | 153 // Returns the URL of the Most Visited item specified by the |item_id|. |
| 156 GURL GetURLForMostVisitedItem(InstantRestrictedID item_id) const; | 154 GURL GetURLForMostVisitedItem(InstantRestrictedID item_id) const; |
| 157 | 155 |
| 158 void Bind(chrome::mojom::SearchBoxAssociatedRequest request); | 156 void Bind(chrome::mojom::SearchBoxAssociatedRequest request); |
| 159 | 157 |
| 160 int page_seq_no_; | 158 int page_seq_no_; |
| 161 bool is_focused_; | 159 bool is_focused_; |
| 162 bool is_input_in_progress_; | 160 bool is_input_in_progress_; |
| 163 bool is_key_capture_enabled_; | 161 bool is_key_capture_enabled_; |
| 164 InstantRestrictedIDCache<InstantMostVisitedItem> most_visited_items_cache_; | 162 InstantRestrictedIDCache<InstantMostVisitedItem> most_visited_items_cache_; |
| 165 ThemeBackgroundInfo theme_info_; | 163 ThemeBackgroundInfo theme_info_; |
| 166 base::string16 query_; | |
| 167 EmbeddedSearchRequestParams embedded_search_request_params_; | 164 EmbeddedSearchRequestParams embedded_search_request_params_; |
| 168 InstantSuggestion suggestion_; | 165 InstantSuggestion suggestion_; |
| 169 chrome::mojom::InstantAssociatedPtr instant_service_; | 166 chrome::mojom::InstantAssociatedPtr instant_service_; |
| 170 mojo::AssociatedBinding<chrome::mojom::SearchBox> binding_; | 167 mojo::AssociatedBinding<chrome::mojom::SearchBox> binding_; |
| 171 | 168 |
| 172 DISALLOW_COPY_AND_ASSIGN(SearchBox); | 169 DISALLOW_COPY_AND_ASSIGN(SearchBox); |
| 173 }; | 170 }; |
| 174 | 171 |
| 175 #endif // CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_ | 172 #endif // CHROME_RENDERER_SEARCHBOX_SEARCHBOX_H_ |
| OLD | NEW |