| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_BROWSER_UI_SEARCH_SEARCH_IPC_ROUTER_H_ | 5 #ifndef CHROME_BROWSER_UI_SEARCH_SEARCH_IPC_ROUTER_H_ |
| 6 #define CHROME_BROWSER_UI_SEARCH_SEARCH_IPC_ROUTER_H_ | 6 #define CHROME_BROWSER_UI_SEARCH_SEARCH_IPC_ROUTER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 virtual bool ShouldSendSetInputInProgress(bool is_active_tab) = 0; | 109 virtual bool ShouldSendSetInputInProgress(bool is_active_tab) = 0; |
| 110 virtual bool ShouldSendOmniboxFocusChanged() = 0; | 110 virtual bool ShouldSendOmniboxFocusChanged() = 0; |
| 111 virtual bool ShouldSendMostVisitedItems() = 0; | 111 virtual bool ShouldSendMostVisitedItems() = 0; |
| 112 virtual bool ShouldSendThemeBackgroundInfo() = 0; | 112 virtual bool ShouldSendThemeBackgroundInfo() = 0; |
| 113 virtual bool ShouldSendToggleVoiceSearch() = 0; | 113 virtual bool ShouldSendToggleVoiceSearch() = 0; |
| 114 virtual bool ShouldSubmitQuery() = 0; | 114 virtual bool ShouldSubmitQuery() = 0; |
| 115 }; | 115 }; |
| 116 | 116 |
| 117 SearchIPCRouter(content::WebContents* web_contents, Delegate* delegate, | 117 SearchIPCRouter(content::WebContents* web_contents, Delegate* delegate, |
| 118 scoped_ptr<Policy> policy); | 118 scoped_ptr<Policy> policy); |
| 119 virtual ~SearchIPCRouter(); | 119 ~SearchIPCRouter() override; |
| 120 | 120 |
| 121 // Tells the SearchIPCRouter that a new page in an Instant process committed. | 121 // Tells the SearchIPCRouter that a new page in an Instant process committed. |
| 122 void OnNavigationEntryCommitted(); | 122 void OnNavigationEntryCommitted(); |
| 123 | 123 |
| 124 // Tells the renderer to determine if the page supports the Instant API, which | 124 // Tells the renderer to determine if the page supports the Instant API, which |
| 125 // results in a call to OnInstantSupportDetermined() when the reply is | 125 // results in a call to OnInstantSupportDetermined() when the reply is |
| 126 // received. | 126 // received. |
| 127 void DetermineIfPageSupportsInstant(); | 127 void DetermineIfPageSupportsInstant(); |
| 128 | 128 |
| 129 // Tells the renderer about the result of the Chrome identity check. | 129 // Tells the renderer about the result of the Chrome identity check. |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 DetermineIfPageSupportsInstant_NonLocal); | 177 DetermineIfPageSupportsInstant_NonLocal); |
| 178 FRIEND_TEST_ALL_PREFIXES(SearchTabHelperTest, | 178 FRIEND_TEST_ALL_PREFIXES(SearchTabHelperTest, |
| 179 PageURLDoesntBelongToInstantRenderer); | 179 PageURLDoesntBelongToInstantRenderer); |
| 180 FRIEND_TEST_ALL_PREFIXES(SearchIPCRouterTest, | 180 FRIEND_TEST_ALL_PREFIXES(SearchIPCRouterTest, |
| 181 IgnoreMessageIfThePageIsNotActive); | 181 IgnoreMessageIfThePageIsNotActive); |
| 182 FRIEND_TEST_ALL_PREFIXES(SearchIPCRouterTest, | 182 FRIEND_TEST_ALL_PREFIXES(SearchIPCRouterTest, |
| 183 DoNotSendSetDisplayInstantResultsMsg); | 183 DoNotSendSetDisplayInstantResultsMsg); |
| 184 FRIEND_TEST_ALL_PREFIXES(SearchIPCRouterTest, HandleTabChangedEvents); | 184 FRIEND_TEST_ALL_PREFIXES(SearchIPCRouterTest, HandleTabChangedEvents); |
| 185 | 185 |
| 186 // Overridden from contents::WebContentsObserver: | 186 // Overridden from contents::WebContentsObserver: |
| 187 virtual bool OnMessageReceived(const IPC::Message& message) override; | 187 bool OnMessageReceived(const IPC::Message& message) override; |
| 188 | 188 |
| 189 void OnInstantSupportDetermined(int page_seq_no, bool supports_instant) const; | 189 void OnInstantSupportDetermined(int page_seq_no, bool supports_instant) const; |
| 190 void OnVoiceSearchSupportDetermined(int page_id, | 190 void OnVoiceSearchSupportDetermined(int page_id, |
| 191 bool supports_voice_search) const; | 191 bool supports_voice_search) const; |
| 192 void OnFocusOmnibox(int page_id, OmniboxFocusState state) const; | 192 void OnFocusOmnibox(int page_id, OmniboxFocusState state) const; |
| 193 void OnSearchBoxNavigate(int page_id, | 193 void OnSearchBoxNavigate(int page_id, |
| 194 const GURL& url, | 194 const GURL& url, |
| 195 WindowOpenDisposition disposition, | 195 WindowOpenDisposition disposition, |
| 196 bool is_most_visited_item_url) const; | 196 bool is_most_visited_item_url) const; |
| 197 void OnDeleteMostVisitedItem(int page_seq_no, const GURL& url) const; | 197 void OnDeleteMostVisitedItem(int page_seq_no, const GURL& url) const; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 228 // SearchIPCRouter to ensure that delayed IPC replies are ignored. | 228 // SearchIPCRouter to ensure that delayed IPC replies are ignored. |
| 229 int commit_counter_; | 229 int commit_counter_; |
| 230 | 230 |
| 231 // Set to true, when the tab corresponding to |this| instance is active. | 231 // Set to true, when the tab corresponding to |this| instance is active. |
| 232 bool is_active_tab_; | 232 bool is_active_tab_; |
| 233 | 233 |
| 234 DISALLOW_COPY_AND_ASSIGN(SearchIPCRouter); | 234 DISALLOW_COPY_AND_ASSIGN(SearchIPCRouter); |
| 235 }; | 235 }; |
| 236 | 236 |
| 237 #endif // CHROME_BROWSER_UI_SEARCH_SEARCH_IPC_ROUTER_H_ | 237 #endif // CHROME_BROWSER_UI_SEARCH_SEARCH_IPC_ROUTER_H_ |
| OLD | NEW |