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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 270 void SetIsCrashed(base::TerminationStatus status, int error_code) override; | 270 void SetIsCrashed(base::TerminationStatus status, int error_code) override; |
| 271 base::TerminationStatus GetCrashedStatus() const override; | 271 base::TerminationStatus GetCrashedStatus() const override; |
| 272 bool IsBeingDestroyed() const override; | 272 bool IsBeingDestroyed() const override; |
| 273 void NotifyNavigationStateChanged(InvalidateTypes changed_flags) override; | 273 void NotifyNavigationStateChanged(InvalidateTypes changed_flags) override; |
| 274 base::TimeTicks GetLastActiveTime() const override; | 274 base::TimeTicks GetLastActiveTime() const override; |
| 275 void SetLastActiveTime(base::TimeTicks last_active_time) override; | 275 void SetLastActiveTime(base::TimeTicks last_active_time) override; |
| 276 void WasShown() override; | 276 void WasShown() override; |
| 277 void WasHidden() override; | 277 void WasHidden() override; |
| 278 bool NeedToFireBeforeUnload() override; | 278 bool NeedToFireBeforeUnload() override; |
| 279 void DispatchBeforeUnload(bool for_cross_site_transition) override; | 279 void DispatchBeforeUnload(bool for_cross_site_transition) override; |
| 280 void AttachToOuterWebContentsFrame( | |
| 281 WebContents* outer_web_contents, | |
| 282 RenderFrameHost* outer_contents_frame) override; | |
| 280 void Stop() override; | 283 void Stop() override; |
| 281 WebContents* Clone() override; | 284 WebContents* Clone() override; |
| 282 void ReloadFocusedFrame(bool ignore_cache) override; | 285 void ReloadFocusedFrame(bool ignore_cache) override; |
| 283 void Undo() override; | 286 void Undo() override; |
| 284 void Redo() override; | 287 void Redo() override; |
| 285 void Cut() override; | 288 void Cut() override; |
| 286 void Copy() override; | 289 void Copy() override; |
| 287 void CopyToFindPboard() override; | 290 void CopyToFindPboard() override; |
| 288 void Paste() override; | 291 void Paste() override; |
| 289 void PasteAndMatchStyle() override; | 292 void PasteAndMatchStyle() override; |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 585 void NotifyMainFrameSwappedFromRenderManager( | 588 void NotifyMainFrameSwappedFromRenderManager( |
| 586 RenderViewHost* old_host, | 589 RenderViewHost* old_host, |
| 587 RenderViewHost* new_host) override; | 590 RenderViewHost* new_host) override; |
| 588 int CreateOpenerRenderViewsForRenderManager(SiteInstance* instance) override; | 591 int CreateOpenerRenderViewsForRenderManager(SiteInstance* instance) override; |
| 589 NavigationControllerImpl& GetControllerForRenderManager() override; | 592 NavigationControllerImpl& GetControllerForRenderManager() override; |
| 590 scoped_ptr<WebUIImpl> CreateWebUIForRenderManager(const GURL& url) override; | 593 scoped_ptr<WebUIImpl> CreateWebUIForRenderManager(const GURL& url) override; |
| 591 NavigationEntry* GetLastCommittedNavigationEntryForRenderManager() override; | 594 NavigationEntry* GetLastCommittedNavigationEntryForRenderManager() override; |
| 592 bool FocusLocationBarByDefault() override; | 595 bool FocusLocationBarByDefault() override; |
| 593 void SetFocusToLocationBar(bool select_all) override; | 596 void SetFocusToLocationBar(bool select_all) override; |
| 594 bool IsHidden() override; | 597 bool IsHidden() override; |
| 598 int GetOuterDelegateFrameTreeNodeID() override; | |
| 595 | 599 |
| 596 // NotificationObserver ------------------------------------------------------ | 600 // NotificationObserver ------------------------------------------------------ |
| 597 | 601 |
| 598 void Observe(int type, | 602 void Observe(int type, |
| 599 const NotificationSource& source, | 603 const NotificationSource& source, |
| 600 const NotificationDetails& details) override; | 604 const NotificationDetails& details) override; |
| 601 | 605 |
| 602 // NavigationControllerDelegate ---------------------------------------------- | 606 // NavigationControllerDelegate ---------------------------------------------- |
| 603 | 607 |
| 604 WebContents* GetWebContents() override; | 608 WebContents* GetWebContents() override; |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 716 CrossSiteIframeAccessibility); | 720 CrossSiteIframeAccessibility); |
| 717 | 721 |
| 718 // So InterstitialPageImpl can access SetIsLoading. | 722 // So InterstitialPageImpl can access SetIsLoading. |
| 719 friend class InterstitialPageImpl; | 723 friend class InterstitialPageImpl; |
| 720 | 724 |
| 721 // TODO(brettw) TestWebContents shouldn't exist! | 725 // TODO(brettw) TestWebContents shouldn't exist! |
| 722 friend class TestWebContents; | 726 friend class TestWebContents; |
| 723 | 727 |
| 724 class DestructionObserver; | 728 class DestructionObserver; |
| 725 | 729 |
| 730 // Represents a WebContents node in a tree of WebContents structure. | |
| 731 // | |
| 732 // Two WebContents with separate FrameTrees can be connected by | |
| 733 // outer/inner relationship using this class. Note that their FrameTrees | |
| 734 // still remain disjoint. | |
| 735 // The root is referred to as "outer WebContents" and the descendents are | |
| 736 // referred to as "inner WebContents". | |
| 737 struct WebContentsTreeNode { | |
| 738 public: | |
| 739 WebContentsTreeNode(); | |
| 740 ~WebContentsTreeNode(); | |
| 741 | |
| 742 void SetOuterWebContents(WebContentsImpl* outer_web_contents); | |
| 743 WebContentsImpl* outer_web_contents() { return outer_web_contents_; } | |
| 744 | |
| 745 private: | |
| 746 WebContentsImpl* outer_web_contents_; | |
| 747 std::set<WebContentsTreeNode*> inner_web_contents_tree_nodes_; | |
|
nasko
2015/05/28 22:13:46
Why does the outer WebContents need to know about
lazyboy
2015/05/29 00:02:24
The outer WebContents(TreeNode) may be destroyed b
| |
| 748 }; | |
| 749 | |
| 726 // See WebContents::Create for a description of these parameters. | 750 // See WebContents::Create for a description of these parameters. |
| 727 WebContentsImpl(BrowserContext* browser_context, | 751 WebContentsImpl(BrowserContext* browser_context, |
| 728 WebContentsImpl* opener); | 752 WebContentsImpl* opener); |
| 729 | 753 |
| 730 // Add and remove observers for page navigation notifications. The order in | 754 // Add and remove observers for page navigation notifications. The order in |
| 731 // which notifications are sent to observers is undefined. Clients must be | 755 // which notifications are sent to observers is undefined. Clients must be |
| 732 // sure to remove the observer before they go away. | 756 // sure to remove the observer before they go away. |
| 733 void AddObserver(WebContentsObserver* observer); | 757 void AddObserver(WebContentsObserver* observer); |
| 734 void RemoveObserver(WebContentsObserver* observer); | 758 void RemoveObserver(WebContentsObserver* observer); |
| 735 | 759 |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1030 scoped_ptr<PowerSaveBlocker> video_power_save_blocker_; | 1054 scoped_ptr<PowerSaveBlocker> video_power_save_blocker_; |
| 1031 | 1055 |
| 1032 // Tells whether this WebContents is actively producing sound. | 1056 // Tells whether this WebContents is actively producing sound. |
| 1033 // Order is important: the |frame_tree_| destruction uses | 1057 // Order is important: the |frame_tree_| destruction uses |
| 1034 // |audio_state_provider_|. | 1058 // |audio_state_provider_|. |
| 1035 scoped_ptr<AudioStateProvider> audio_state_provider_; | 1059 scoped_ptr<AudioStateProvider> audio_state_provider_; |
| 1036 | 1060 |
| 1037 // Manages the frame tree of the page and process swaps in each node. | 1061 // Manages the frame tree of the page and process swaps in each node. |
| 1038 FrameTree frame_tree_; | 1062 FrameTree frame_tree_; |
| 1039 | 1063 |
| 1064 // If this WebContents is part of a "tree of WebContents", then this contains | |
| 1065 // information about the structure. | |
| 1066 WebContentsTreeNode node_; | |
| 1067 | |
| 1040 // SavePackage, lazily created. | 1068 // SavePackage, lazily created. |
| 1041 scoped_refptr<SavePackage> save_package_; | 1069 scoped_refptr<SavePackage> save_package_; |
| 1042 | 1070 |
| 1043 // Data for loading state ---------------------------------------------------- | 1071 // Data for loading state ---------------------------------------------------- |
| 1044 | 1072 |
| 1045 // Indicates whether we're currently loading a resource. | 1073 // Indicates whether we're currently loading a resource. |
| 1046 bool is_loading_; | 1074 bool is_loading_; |
| 1047 | 1075 |
| 1048 // Indicates whether the current load is to a different document. Only valid | 1076 // Indicates whether the current load is to a different document. Only valid |
| 1049 // if is_loading_ is true. | 1077 // if is_loading_ is true. |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1273 // Adds/removes a callback called on creation of each new WebContents. | 1301 // Adds/removes a callback called on creation of each new WebContents. |
| 1274 static void AddCreatedCallbackForTesting(const CreatedCallback& callback); | 1302 static void AddCreatedCallbackForTesting(const CreatedCallback& callback); |
| 1275 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback); | 1303 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback); |
| 1276 | 1304 |
| 1277 DISALLOW_COPY_AND_ASSIGN(FriendZone); | 1305 DISALLOW_COPY_AND_ASSIGN(FriendZone); |
| 1278 }; | 1306 }; |
| 1279 | 1307 |
| 1280 } // namespace content | 1308 } // namespace content |
| 1281 | 1309 |
| 1282 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ | 1310 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ |
| OLD | NEW |