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/macros.h" | 8 #include "base/macros.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 ~SearchIPCRouterPolicyImpl() override; | 19 ~SearchIPCRouterPolicyImpl() override; |
20 | 20 |
21 private: | 21 private: |
22 friend class SearchIPCRouterPolicyTest; | 22 friend class SearchIPCRouterPolicyTest; |
23 | 23 |
24 // Overridden from SearchIPCRouter::Policy: | 24 // Overridden from SearchIPCRouter::Policy: |
25 bool ShouldProcessFocusOmnibox(bool is_active_tab) override; | 25 bool ShouldProcessFocusOmnibox(bool is_active_tab) override; |
26 bool ShouldProcessNavigateToURL(bool is_active_tab) override; | |
27 bool ShouldProcessDeleteMostVisitedItem() override; | 26 bool ShouldProcessDeleteMostVisitedItem() override; |
28 bool ShouldProcessUndoMostVisitedDeletion() override; | 27 bool ShouldProcessUndoMostVisitedDeletion() override; |
29 bool ShouldProcessUndoAllMostVisitedDeletions() override; | 28 bool ShouldProcessUndoAllMostVisitedDeletions() override; |
30 bool ShouldProcessLogEvent() override; | 29 bool ShouldProcessLogEvent() override; |
31 bool ShouldProcessPasteIntoOmnibox(bool is_active_tab) override; | 30 bool ShouldProcessPasteIntoOmnibox(bool is_active_tab) override; |
32 bool ShouldProcessChromeIdentityCheck() override; | 31 bool ShouldProcessChromeIdentityCheck() override; |
33 bool ShouldProcessHistorySyncCheck() override; | 32 bool ShouldProcessHistorySyncCheck() override; |
34 bool ShouldSendSetPromoInformation() override; | 33 bool ShouldSendSetPromoInformation() override; |
35 bool ShouldSendSetDisplayInstantResults() override; | 34 bool ShouldSendSetDisplayInstantResults() override; |
36 bool ShouldSendSetSuggestionToPrefetch() override; | 35 bool ShouldSendSetSuggestionToPrefetch() override; |
37 bool ShouldSendSetInputInProgress(bool is_active_tab) override; | 36 bool ShouldSendSetInputInProgress(bool is_active_tab) override; |
38 bool ShouldSendOmniboxFocusChanged() override; | 37 bool ShouldSendOmniboxFocusChanged() override; |
39 bool ShouldSendMostVisitedItems() override; | 38 bool ShouldSendMostVisitedItems() override; |
40 bool ShouldSendThemeBackgroundInfo() override; | 39 bool ShouldSendThemeBackgroundInfo() override; |
41 bool ShouldSubmitQuery() override; | 40 bool ShouldSubmitQuery() override; |
42 | 41 |
43 // Used by unit tests. | 42 // Used by unit tests. |
44 void set_is_incognito(bool is_incognito) { | 43 void set_is_incognito(bool is_incognito) { |
45 is_incognito_ = is_incognito; | 44 is_incognito_ = is_incognito; |
46 } | 45 } |
47 | 46 |
48 const content::WebContents* web_contents_; | 47 const content::WebContents* web_contents_; |
49 bool is_incognito_; | 48 bool is_incognito_; |
50 | 49 |
51 DISALLOW_COPY_AND_ASSIGN(SearchIPCRouterPolicyImpl); | 50 DISALLOW_COPY_AND_ASSIGN(SearchIPCRouterPolicyImpl); |
52 }; | 51 }; |
53 | 52 |
54 #endif // CHROME_BROWSER_UI_SEARCH_SEARCH_IPC_ROUTER_POLICY_IMPL_H_ | 53 #endif // CHROME_BROWSER_UI_SEARCH_SEARCH_IPC_ROUTER_POLICY_IMPL_H_ |
OLD | NEW |