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_BROWSER_UI_SEARCH_SEARCH_TAB_HELPER_H_ | 5 #ifndef CHROME_BROWSER_UI_SEARCH_SEARCH_TAB_HELPER_H_ |
6 #define CHROME_BROWSER_UI_SEARCH_SEARCH_TAB_HELPER_H_ | 6 #define CHROME_BROWSER_UI_SEARCH_SEARCH_TAB_HELPER_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 20 matching lines...) Expand all Loading... |
31 class GURL; | 31 class GURL; |
32 class InstantService; | 32 class InstantService; |
33 class InstantTabTest; | 33 class InstantTabTest; |
34 class OmniboxView; | 34 class OmniboxView; |
35 class Profile; | 35 class Profile; |
36 class SearchIPCRouterTest; | 36 class SearchIPCRouterTest; |
37 | 37 |
38 // Per-tab search "helper". Acts as the owner and controller of the tab's | 38 // Per-tab search "helper". Acts as the owner and controller of the tab's |
39 // search UI model. | 39 // search UI model. |
40 // | 40 // |
41 // When the page is finished loading, SearchTabHelper determines the instant | 41 // When a navigation is committed and when the page is finished loading, |
42 // support for the page. When a navigation entry is committed (except for | 42 // SearchTabHelper determines the instant support for the page, i.e. whether |
43 // in-page navigations), SearchTabHelper resets the instant support state to | 43 // the page is rendered in the instant process. |
44 // INSTANT_SUPPORT_UNKNOWN and cause support to be determined again. | |
45 class SearchTabHelper : public content::WebContentsObserver, | 44 class SearchTabHelper : public content::WebContentsObserver, |
46 public content::WebContentsUserData<SearchTabHelper>, | 45 public content::WebContentsUserData<SearchTabHelper>, |
47 public InstantServiceObserver, | 46 public InstantServiceObserver, |
48 public SearchIPCRouter::Delegate { | 47 public SearchIPCRouter::Delegate { |
49 public: | 48 public: |
50 ~SearchTabHelper() override; | 49 ~SearchTabHelper() override; |
51 | 50 |
52 SearchModel* model() { | 51 SearchModel* model() { |
53 return &model_; | 52 return &model_; |
54 } | 53 } |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 void DidStartNavigation( | 126 void DidStartNavigation( |
128 content::NavigationHandle* navigation_handle) override; | 127 content::NavigationHandle* navigation_handle) override; |
129 void DidFinishNavigation( | 128 void DidFinishNavigation( |
130 content::NavigationHandle* navigation_handle) override; | 129 content::NavigationHandle* navigation_handle) override; |
131 void DidFinishLoad(content::RenderFrameHost* render_frame_host, | 130 void DidFinishLoad(content::RenderFrameHost* render_frame_host, |
132 const GURL& validated_url) override; | 131 const GURL& validated_url) override; |
133 void NavigationEntryCommitted( | 132 void NavigationEntryCommitted( |
134 const content::LoadCommittedDetails& load_details) override; | 133 const content::LoadCommittedDetails& load_details) override; |
135 | 134 |
136 // Overridden from SearchIPCRouter::Delegate: | 135 // Overridden from SearchIPCRouter::Delegate: |
137 void OnInstantSupportDetermined(bool supports_instant) override; | |
138 void FocusOmnibox(OmniboxFocusState state) override; | 136 void FocusOmnibox(OmniboxFocusState state) override; |
139 void OnDeleteMostVisitedItem(const GURL& url) override; | 137 void OnDeleteMostVisitedItem(const GURL& url) override; |
140 void OnUndoMostVisitedDeletion(const GURL& url) override; | 138 void OnUndoMostVisitedDeletion(const GURL& url) override; |
141 void OnUndoAllMostVisitedDeletions() override; | 139 void OnUndoAllMostVisitedDeletions() override; |
142 void OnLogEvent(NTPLoggingEventType event, base::TimeDelta time) override; | 140 void OnLogEvent(NTPLoggingEventType event, base::TimeDelta time) override; |
143 void OnLogMostVisitedImpression(int position, | 141 void OnLogMostVisitedImpression(int position, |
144 ntp_tiles::TileSource tile_source, | 142 ntp_tiles::TileSource tile_source, |
145 ntp_tiles::TileVisualType tile_type) override; | 143 ntp_tiles::TileVisualType tile_type) override; |
146 void OnLogMostVisitedNavigation(int position, | 144 void OnLogMostVisitedNavigation(int position, |
147 ntp_tiles::TileSource tile_source, | 145 ntp_tiles::TileSource tile_source, |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 content::WebContents* web_contents_; | 178 content::WebContents* web_contents_; |
181 | 179 |
182 SearchIPCRouter ipc_router_; | 180 SearchIPCRouter ipc_router_; |
183 | 181 |
184 InstantService* instant_service_; | 182 InstantService* instant_service_; |
185 | 183 |
186 DISALLOW_COPY_AND_ASSIGN(SearchTabHelper); | 184 DISALLOW_COPY_AND_ASSIGN(SearchTabHelper); |
187 }; | 185 }; |
188 | 186 |
189 #endif // CHROME_BROWSER_UI_SEARCH_SEARCH_TAB_HELPER_H_ | 187 #endif // CHROME_BROWSER_UI_SEARCH_SEARCH_TAB_HELPER_H_ |
OLD | NEW |