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_POLICY_IMPL_H_ | 5 #ifndef CHROME_BROWSER_UI_SEARCH_SEARCH_IPC_ROUTER_POLICY_IMPL_H_ |
6 #define CHROME_BROWSER_UI_SEARCH_SEARCH_IPC_ROUTER_POLICY_IMPL_H_ | 6 #define CHROME_BROWSER_UI_SEARCH_SEARCH_IPC_ROUTER_POLICY_IMPL_H_ |
7 | 7 |
8 #include "base/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
9 #include "chrome/browser/ui/search/search_ipc_router.h" | 9 #include "chrome/browser/ui/search/search_ipc_router.h" |
10 | 10 |
11 namespace content { | 11 namespace content { |
12 class WebContents; | 12 class WebContents; |
13 } | 13 } |
14 | 14 |
15 // The SearchIPCRouter::Policy implementation. | 15 // The SearchIPCRouter::Policy implementation. |
16 class SearchIPCRouterPolicyImpl : public SearchIPCRouter::Policy { | 16 class SearchIPCRouterPolicyImpl : public SearchIPCRouter::Policy { |
17 public: | 17 public: |
18 explicit SearchIPCRouterPolicyImpl(const content::WebContents* web_contents); | 18 explicit SearchIPCRouterPolicyImpl(const content::WebContents* web_contents); |
19 virtual ~SearchIPCRouterPolicyImpl(); | 19 virtual ~SearchIPCRouterPolicyImpl(); |
20 | 20 |
21 private: | 21 private: |
22 FRIEND_TEST_ALL_PREFIXES(SearchIPCRouterPolicyTest, | 22 FRIEND_TEST_ALL_PREFIXES(SearchIPCRouterPolicyTest, |
23 ProcessVoiceSearchSupportMsg); | 23 ProcessVoiceSearchSupportMsg); |
24 FRIEND_TEST_ALL_PREFIXES(SearchIPCRouterPolicyTest, | 24 FRIEND_TEST_ALL_PREFIXES(SearchIPCRouterPolicyTest, |
25 SendSetDisplayInstantResults); | 25 SendSetDisplayInstantResults); |
26 FRIEND_TEST_ALL_PREFIXES(SearchIPCRouterPolicyTest, | 26 FRIEND_TEST_ALL_PREFIXES(SearchIPCRouterPolicyTest, |
27 DoNotSetDisplayInstantResultsForIncognitoPage); | 27 DoNotSendSetMessagesForIncognitoPage); |
28 FRIEND_TEST_ALL_PREFIXES(SearchIPCRouterPolicyTest, | 28 FRIEND_TEST_ALL_PREFIXES(SearchIPCRouterPolicyTest, |
29 DoNotSendMostVisitedItemsForIncognitoPage); | 29 DoNotSendMostVisitedItemsForIncognitoPage); |
30 FRIEND_TEST_ALL_PREFIXES(SearchIPCRouterPolicyTest, | 30 FRIEND_TEST_ALL_PREFIXES(SearchIPCRouterPolicyTest, |
31 DoNotSendThemeBackgroundInfoForIncognitoPage); | 31 DoNotSendThemeBackgroundInfoForIncognitoPage); |
32 | 32 |
33 // Overridden from SearchIPCRouter::Policy: | 33 // Overridden from SearchIPCRouter::Policy: |
34 virtual bool ShouldProcessSetVoiceSearchSupport() OVERRIDE; | 34 virtual bool ShouldProcessSetVoiceSearchSupport() OVERRIDE; |
35 virtual bool ShouldSendSetDisplayInstantResults() OVERRIDE; | 35 virtual bool ShouldSendSetDisplayInstantResults() OVERRIDE; |
| 36 virtual bool ShouldSendSetSuggestionToPrefetch() OVERRIDE; |
36 virtual bool ShouldSendMostVisitedItems() OVERRIDE; | 37 virtual bool ShouldSendMostVisitedItems() OVERRIDE; |
37 virtual bool ShouldSendThemeBackgroundInfo() OVERRIDE; | 38 virtual bool ShouldSendThemeBackgroundInfo() OVERRIDE; |
38 | 39 |
39 // Used by unit tests. | 40 // Used by unit tests. |
40 void set_is_incognito(bool is_incognito) { | 41 void set_is_incognito(bool is_incognito) { |
41 is_incognito_ = is_incognito; | 42 is_incognito_ = is_incognito; |
42 } | 43 } |
43 | 44 |
44 const content::WebContents* web_contents_; | 45 const content::WebContents* web_contents_; |
45 bool is_incognito_; | 46 bool is_incognito_; |
46 | 47 |
47 DISALLOW_COPY_AND_ASSIGN(SearchIPCRouterPolicyImpl); | 48 DISALLOW_COPY_AND_ASSIGN(SearchIPCRouterPolicyImpl); |
48 }; | 49 }; |
49 | 50 |
50 #endif // CHROME_BROWSER_UI_SEARCH_SEARCH_IPC_ROUTER_POLICY_IMPL_H_ | 51 #endif // CHROME_BROWSER_UI_SEARCH_SEARCH_IPC_ROUTER_POLICY_IMPL_H_ |
OLD | NEW |