| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_PRERENDER_PRERENDER_CONTENTS_H_ | 5 #ifndef CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ |
| 6 #define CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ | 6 #define CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 public: | 74 public: |
| 75 // Signals that the prerender has started running. | 75 // Signals that the prerender has started running. |
| 76 virtual void OnPrerenderStart(PrerenderContents* contents) = 0; | 76 virtual void OnPrerenderStart(PrerenderContents* contents) = 0; |
| 77 | 77 |
| 78 // Signals that the prerender has had its load event. | 78 // Signals that the prerender has had its load event. |
| 79 virtual void OnPrerenderStopLoading(PrerenderContents* contents); | 79 virtual void OnPrerenderStopLoading(PrerenderContents* contents); |
| 80 | 80 |
| 81 // Signals that the prerender has stopped running. | 81 // Signals that the prerender has stopped running. |
| 82 virtual void OnPrerenderStop(PrerenderContents* contents) = 0; | 82 virtual void OnPrerenderStop(PrerenderContents* contents) = 0; |
| 83 | 83 |
| 84 // Signals the discovery, through redirects, of a new alias for this | |
| 85 // prerender. | |
| 86 virtual void OnPrerenderAddAlias(PrerenderContents* contents, | |
| 87 const GURL& alias_url); | |
| 88 | |
| 89 // Signals that this prerender has just become a MatchComplete replacement. | 84 // Signals that this prerender has just become a MatchComplete replacement. |
| 90 virtual void OnPrerenderCreatedMatchCompleteReplacement( | 85 virtual void OnPrerenderCreatedMatchCompleteReplacement( |
| 91 PrerenderContents* contents, PrerenderContents* replacement); | 86 PrerenderContents* contents, PrerenderContents* replacement); |
| 92 | 87 |
| 93 protected: | 88 protected: |
| 94 Observer(); | 89 Observer(); |
| 95 virtual ~Observer() = 0; | 90 virtual ~Observer() = 0; |
| 96 }; | 91 }; |
| 97 | 92 |
| 98 // A container for extra data on pending prerenders. | 93 // A container for extra data on pending prerenders. |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 const GURL& url, | 286 const GURL& url, |
| 292 const content::Referrer& referrer, | 287 const content::Referrer& referrer, |
| 293 Origin origin, | 288 Origin origin, |
| 294 uint8 experiment_id); | 289 uint8 experiment_id); |
| 295 | 290 |
| 296 // These call out to methods on our Observers, using our observer_list_. Note | 291 // These call out to methods on our Observers, using our observer_list_. Note |
| 297 // that NotifyPrerenderStop() also clears the observer list. | 292 // that NotifyPrerenderStop() also clears the observer list. |
| 298 void NotifyPrerenderStart(); | 293 void NotifyPrerenderStart(); |
| 299 void NotifyPrerenderStopLoading(); | 294 void NotifyPrerenderStopLoading(); |
| 300 void NotifyPrerenderStop(); | 295 void NotifyPrerenderStop(); |
| 301 void NotifyPrerenderAddAlias(const GURL& alias_url); | |
| 302 void NotifyPrerenderCreatedMatchCompleteReplacement( | 296 void NotifyPrerenderCreatedMatchCompleteReplacement( |
| 303 PrerenderContents* replacement); | 297 PrerenderContents* replacement); |
| 304 | 298 |
| 305 // Called whenever a RenderViewHost is created for prerendering. Only called | 299 // Called whenever a RenderViewHost is created for prerendering. Only called |
| 306 // once the RenderViewHost has a RenderView and RenderWidgetHostView. | 300 // once the RenderViewHost has a RenderView and RenderWidgetHostView. |
| 307 virtual void OnRenderViewHostCreated( | 301 virtual void OnRenderViewHostCreated( |
| 308 content::RenderViewHost* new_render_view_host); | 302 content::RenderViewHost* new_render_view_host); |
| 309 | 303 |
| 310 content::NotificationRegistrar& notification_registrar() { | 304 content::NotificationRegistrar& notification_registrar() { |
| 311 return notification_registrar_; | 305 return notification_registrar_; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 | 420 |
| 427 // Caches pages to be added to the history. | 421 // Caches pages to be added to the history. |
| 428 AddPageVector add_page_vector_; | 422 AddPageVector add_page_vector_; |
| 429 | 423 |
| 430 DISALLOW_COPY_AND_ASSIGN(PrerenderContents); | 424 DISALLOW_COPY_AND_ASSIGN(PrerenderContents); |
| 431 }; | 425 }; |
| 432 | 426 |
| 433 } // namespace prerender | 427 } // namespace prerender |
| 434 | 428 |
| 435 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ | 429 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ |
| OLD | NEW |