| 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_INSTANT_PAGE_H_ | 5 #ifndef CHROME_BROWSER_UI_SEARCH_INSTANT_PAGE_H_ |
| 6 #define CHROME_BROWSER_UI_SEARCH_INSTANT_PAGE_H_ | 6 #define CHROME_BROWSER_UI_SEARCH_INSTANT_PAGE_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 // Called upon determination of Instant API support. Either in response to | 45 // Called upon determination of Instant API support. Either in response to |
| 46 // the page loading or because we received some other message. | 46 // the page loading or because we received some other message. |
| 47 virtual void InstantSupportDetermined(const content::WebContents* contents, | 47 virtual void InstantSupportDetermined(const content::WebContents* contents, |
| 48 bool supports_instant) = 0; | 48 bool supports_instant) = 0; |
| 49 | 49 |
| 50 // Called when the page is about to navigate to |url|. | 50 // Called when the page is about to navigate to |url|. |
| 51 virtual void InstantPageAboutToNavigateMainFrame( | 51 virtual void InstantPageAboutToNavigateMainFrame( |
| 52 const content::WebContents* contents, | 52 const content::WebContents* contents, |
| 53 const GURL& url) = 0; | 53 const GURL& url) = 0; |
| 54 | 54 |
| 55 // Called when the page fails to load for whatever reason. | |
| 56 virtual void InstantPageLoadFailed(content::WebContents* contents) = 0; | |
| 57 | |
| 58 protected: | 55 protected: |
| 59 virtual ~Delegate(); | 56 virtual ~Delegate(); |
| 60 }; | 57 }; |
| 61 | 58 |
| 62 virtual ~InstantPage(); | 59 virtual ~InstantPage(); |
| 63 | 60 |
| 64 // The WebContents corresponding to the page we're talking to. May be NULL. | 61 // The WebContents corresponding to the page we're talking to. May be NULL. |
| 65 content::WebContents* contents() const { return web_contents(); } | 62 content::WebContents* contents() const { return web_contents(); } |
| 66 | 63 |
| 67 // Used to send IPC messages to the page. | 64 // Used to send IPC messages to the page. |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 AppropriateMessagesSentToIncognitoPages); | 109 AppropriateMessagesSentToIncognitoPages); |
| 113 | 110 |
| 114 // Overridden from content::WebContentsObserver: | 111 // Overridden from content::WebContentsObserver: |
| 115 virtual void DidCommitProvisionalLoadForFrame( | 112 virtual void DidCommitProvisionalLoadForFrame( |
| 116 int64 frame_id, | 113 int64 frame_id, |
| 117 const base::string16& frame_unique_name, | 114 const base::string16& frame_unique_name, |
| 118 bool is_main_frame, | 115 bool is_main_frame, |
| 119 const GURL& url, | 116 const GURL& url, |
| 120 content::PageTransition transition_type, | 117 content::PageTransition transition_type, |
| 121 content::RenderViewHost* render_view_host) OVERRIDE; | 118 content::RenderViewHost* render_view_host) OVERRIDE; |
| 122 virtual void DidNavigateMainFrame( | |
| 123 const content::LoadCommittedDetails& details, | |
| 124 const content::FrameNavigateParams& params) OVERRIDE; | |
| 125 virtual void DidFailProvisionalLoad( | |
| 126 int64 frame_id, | |
| 127 const base::string16& frame_unique_name, | |
| 128 bool is_main_frame, | |
| 129 const GURL& validated_url, | |
| 130 int error_code, | |
| 131 const base::string16& error_description, | |
| 132 content::RenderViewHost* render_view_host) OVERRIDE; | |
| 133 | 119 |
| 134 // Overridden from SearchModelObserver: | 120 // Overridden from SearchModelObserver: |
| 135 virtual void ModelChanged(const SearchModel::State& old_state, | 121 virtual void ModelChanged(const SearchModel::State& old_state, |
| 136 const SearchModel::State& new_state) OVERRIDE; | 122 const SearchModel::State& new_state) OVERRIDE; |
| 137 | 123 |
| 138 // Update the status of Instant support. | 124 // Update the status of Instant support. |
| 139 void InstantSupportDetermined(bool supports_instant); | 125 void InstantSupportDetermined(bool supports_instant); |
| 140 | 126 |
| 141 void ClearContents(); | 127 void ClearContents(); |
| 142 | 128 |
| 143 // TODO(kmadhusu): Remove |profile_| from here and update InstantNTP to get | 129 // TODO(kmadhusu): Remove |profile_| from here and update InstantNTP to get |
| 144 // |profile| from InstantNTPPrerenderer. | 130 // |profile| from InstantNTPPrerenderer. |
| 145 Profile* profile_; | 131 Profile* profile_; |
| 146 | 132 |
| 147 Delegate* const delegate_; | 133 Delegate* const delegate_; |
| 148 scoped_ptr<InstantIPCSender> ipc_sender_; | 134 scoped_ptr<InstantIPCSender> ipc_sender_; |
| 149 const std::string instant_url_; | 135 const std::string instant_url_; |
| 150 const bool is_incognito_; | 136 const bool is_incognito_; |
| 151 | 137 |
| 152 DISALLOW_COPY_AND_ASSIGN(InstantPage); | 138 DISALLOW_COPY_AND_ASSIGN(InstantPage); |
| 153 }; | 139 }; |
| 154 | 140 |
| 155 #endif // CHROME_BROWSER_UI_SEARCH_INSTANT_PAGE_H_ | 141 #endif // CHROME_BROWSER_UI_SEARCH_INSTANT_PAGE_H_ |
| OLD | NEW |