Chromium Code Reviews| 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 CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ |
| 6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ | 6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 340 const PageState& page_state) OVERRIDE; | 340 const PageState& page_state) OVERRIDE; |
| 341 virtual void UpdateTitle(RenderViewHost* render_view_host, | 341 virtual void UpdateTitle(RenderViewHost* render_view_host, |
| 342 int32 page_id, | 342 int32 page_id, |
| 343 const string16& title, | 343 const string16& title, |
| 344 base::i18n::TextDirection title_direction) OVERRIDE; | 344 base::i18n::TextDirection title_direction) OVERRIDE; |
| 345 virtual void UpdateEncoding(RenderViewHost* render_view_host, | 345 virtual void UpdateEncoding(RenderViewHost* render_view_host, |
| 346 const std::string& encoding) OVERRIDE; | 346 const std::string& encoding) OVERRIDE; |
| 347 virtual void UpdateTargetURL(int32 page_id, const GURL& url) OVERRIDE; | 347 virtual void UpdateTargetURL(int32 page_id, const GURL& url) OVERRIDE; |
| 348 virtual void Close(RenderViewHost* render_view_host) OVERRIDE; | 348 virtual void Close(RenderViewHost* render_view_host) OVERRIDE; |
| 349 virtual void RequestMove(const gfx::Rect& new_bounds) OVERRIDE; | 349 virtual void RequestMove(const gfx::Rect& new_bounds) OVERRIDE; |
| 350 virtual void OnCrossSiteResponse( | |
| 351 RenderViewHost* pending_render_view_host, | |
| 352 const GlobalRequestID& global_request_id) OVERRIDE; | |
| 350 virtual void SwappedOut(RenderViewHost* render_view_host) OVERRIDE; | 353 virtual void SwappedOut(RenderViewHost* render_view_host) OVERRIDE; |
| 351 virtual void DidStartLoading(RenderViewHost* render_view_host) OVERRIDE; | 354 virtual void DidStartLoading(RenderViewHost* render_view_host) OVERRIDE; |
| 352 virtual void DidStopLoading(RenderViewHost* render_view_host) OVERRIDE; | 355 virtual void DidStopLoading(RenderViewHost* render_view_host) OVERRIDE; |
| 353 virtual void DidCancelLoading() OVERRIDE; | 356 virtual void DidCancelLoading() OVERRIDE; |
| 354 virtual void DidChangeLoadProgress(double progress) OVERRIDE; | 357 virtual void DidChangeLoadProgress(double progress) OVERRIDE; |
| 355 virtual void DidDisownOpener(RenderViewHost* rvh) OVERRIDE; | 358 virtual void DidDisownOpener(RenderViewHost* rvh) OVERRIDE; |
| 356 virtual void DidAccessInitialDocument() OVERRIDE; | 359 virtual void DidAccessInitialDocument() OVERRIDE; |
| 357 virtual void DocumentAvailableInMainFrame( | 360 virtual void DocumentAvailableInMainFrame( |
| 358 RenderViewHost* render_view_host) OVERRIDE; | 361 RenderViewHost* render_view_host) OVERRIDE; |
| 359 virtual void DocumentOnLoadCompletedInMainFrame( | 362 virtual void DocumentOnLoadCompletedInMainFrame( |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 507 FRIEND_TEST_ALL_PREFIXES(RenderViewHostManagerTest, PageDoesBackAndReload); | 510 FRIEND_TEST_ALL_PREFIXES(RenderViewHostManagerTest, PageDoesBackAndReload); |
| 508 | 511 |
| 509 // So InterstitialPageImpl can access SetIsLoading. | 512 // So InterstitialPageImpl can access SetIsLoading. |
| 510 friend class InterstitialPageImpl; | 513 friend class InterstitialPageImpl; |
| 511 | 514 |
| 512 // TODO(brettw) TestWebContents shouldn't exist! | 515 // TODO(brettw) TestWebContents shouldn't exist! |
| 513 friend class TestWebContents; | 516 friend class TestWebContents; |
| 514 | 517 |
| 515 class DestructionObserver; | 518 class DestructionObserver; |
| 516 | 519 |
| 520 // Tracks information about a navigation while a cross-process transition is | |
| 521 // in progress. | |
| 522 // TODO(creis): Add transfer navigation params for http://crbug.com/238331. | |
| 523 struct PendingNavigationParams { | |
| 524 PendingNavigationParams(); | |
| 525 PendingNavigationParams(const GlobalRequestID& global_request_id); | |
|
nasko
2013/06/05 18:17:07
The one argument constructor needs explicit keywor
Charlie Reis
2013/06/05 23:03:34
Done.
| |
| 526 | |
| 527 GlobalRequestID global_request_id; | |
| 528 }; | |
| 529 | |
| 517 // See WebContents::Create for a description of these parameters. | 530 // See WebContents::Create for a description of these parameters. |
| 518 WebContentsImpl(BrowserContext* browser_context, | 531 WebContentsImpl(BrowserContext* browser_context, |
| 519 WebContentsImpl* opener); | 532 WebContentsImpl* opener); |
| 520 | 533 |
| 521 // Add and remove observers for page navigation notifications. Adding or | 534 // Add and remove observers for page navigation notifications. Adding or |
| 522 // removing multiple times has no effect. The order in which notifications | 535 // removing multiple times has no effect. The order in which notifications |
| 523 // are sent to observers is undefined. Clients must be sure to remove the | 536 // are sent to observers is undefined. Clients must be sure to remove the |
| 524 // observer before they go away. | 537 // observer before they go away. |
| 525 void AddObserver(WebContentsObserver* observer); | 538 void AddObserver(WebContentsObserver* observer); |
| 526 void RemoveObserver(WebContentsObserver* observer); | 539 void RemoveObserver(WebContentsObserver* observer); |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 796 | 809 |
| 797 // Indicates if the tab is considered crashed. | 810 // Indicates if the tab is considered crashed. |
| 798 base::TerminationStatus crashed_status_; | 811 base::TerminationStatus crashed_status_; |
| 799 int crashed_error_code_; | 812 int crashed_error_code_; |
| 800 | 813 |
| 801 // Whether this WebContents is waiting for a first-response for the | 814 // Whether this WebContents is waiting for a first-response for the |
| 802 // main resource of the page. This controls whether the throbber state is | 815 // main resource of the page. This controls whether the throbber state is |
| 803 // "waiting" or "loading." | 816 // "waiting" or "loading." |
| 804 bool waiting_for_response_; | 817 bool waiting_for_response_; |
| 805 | 818 |
| 819 // Tracks information about any current pending cross-process navigation. | |
| 820 scoped_ptr<PendingNavigationParams> pending_nav_params_; | |
| 821 | |
| 806 // Map of SiteInstance ID to max page ID for this tab. A page ID is specific | 822 // Map of SiteInstance ID to max page ID for this tab. A page ID is specific |
| 807 // to a given tab and SiteInstance, and must be valid for the lifetime of the | 823 // to a given tab and SiteInstance, and must be valid for the lifetime of the |
| 808 // WebContentsImpl. | 824 // WebContentsImpl. |
| 809 std::map<int32, int32> max_page_ids_; | 825 std::map<int32, int32> max_page_ids_; |
| 810 | 826 |
| 811 // System time at which the current load was started. | 827 // System time at which the current load was started. |
| 812 base::TimeTicks current_load_start_; | 828 base::TimeTicks current_load_start_; |
| 813 | 829 |
| 814 // The current load state and the URL associated with it. | 830 // The current load state and the URL associated with it. |
| 815 net::LoadStateWithParam load_state_; | 831 net::LoadStateWithParam load_state_; |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 944 // Maps the ids of pending image downloads to their callbacks | 960 // Maps the ids of pending image downloads to their callbacks |
| 945 typedef std::map<int, ImageDownloadCallback> ImageDownloadMap; | 961 typedef std::map<int, ImageDownloadCallback> ImageDownloadMap; |
| 946 ImageDownloadMap image_download_map_; | 962 ImageDownloadMap image_download_map_; |
| 947 | 963 |
| 948 DISALLOW_COPY_AND_ASSIGN(WebContentsImpl); | 964 DISALLOW_COPY_AND_ASSIGN(WebContentsImpl); |
| 949 }; | 965 }; |
| 950 | 966 |
| 951 } // namespace content | 967 } // namespace content |
| 952 | 968 |
| 953 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ | 969 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ |
| OLD | NEW |