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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
269 bool IsCrashed() const override; | 269 bool IsCrashed() const override; |
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 WasShown() override; | 275 void WasShown() override; |
276 void WasHidden() override; | 276 void WasHidden() override; |
277 bool NeedToFireBeforeUnload() override; | 277 bool NeedToFireBeforeUnload() override; |
278 void DispatchBeforeUnload(bool for_cross_site_transition) override; | 278 void DispatchBeforeUnload(bool for_cross_site_transition) override; |
279 void AttachToOuterWebContentsFrame( | |
280 WebContents* outer_web_contents, | |
281 RenderFrameHost* outer_contents_frame) override; | |
279 void Stop() override; | 282 void Stop() override; |
280 WebContents* Clone() override; | 283 WebContents* Clone() override; |
281 void ReloadFocusedFrame(bool ignore_cache) override; | 284 void ReloadFocusedFrame(bool ignore_cache) override; |
282 void Undo() override; | 285 void Undo() override; |
283 void Redo() override; | 286 void Redo() override; |
284 void Cut() override; | 287 void Cut() override; |
285 void Copy() override; | 288 void Copy() override; |
286 void CopyToFindPboard() override; | 289 void CopyToFindPboard() override; |
287 void Paste() override; | 290 void Paste() override; |
288 void PasteAndMatchStyle() override; | 291 void PasteAndMatchStyle() override; |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
584 void NotifyMainFrameSwappedFromRenderManager( | 587 void NotifyMainFrameSwappedFromRenderManager( |
585 RenderViewHost* old_host, | 588 RenderViewHost* old_host, |
586 RenderViewHost* new_host) override; | 589 RenderViewHost* new_host) override; |
587 int CreateOpenerRenderViewsForRenderManager(SiteInstance* instance) override; | 590 int CreateOpenerRenderViewsForRenderManager(SiteInstance* instance) override; |
588 NavigationControllerImpl& GetControllerForRenderManager() override; | 591 NavigationControllerImpl& GetControllerForRenderManager() override; |
589 scoped_ptr<WebUIImpl> CreateWebUIForRenderManager(const GURL& url) override; | 592 scoped_ptr<WebUIImpl> CreateWebUIForRenderManager(const GURL& url) override; |
590 NavigationEntry* GetLastCommittedNavigationEntryForRenderManager() override; | 593 NavigationEntry* GetLastCommittedNavigationEntryForRenderManager() override; |
591 bool FocusLocationBarByDefault() override; | 594 bool FocusLocationBarByDefault() override; |
592 void SetFocusToLocationBar(bool select_all) override; | 595 void SetFocusToLocationBar(bool select_all) override; |
593 bool IsHidden() override; | 596 bool IsHidden() override; |
597 int GetOuterWebContentsFrameTreeNodeID() override; | |
594 | 598 |
595 // NotificationObserver ------------------------------------------------------ | 599 // NotificationObserver ------------------------------------------------------ |
596 | 600 |
597 void Observe(int type, | 601 void Observe(int type, |
598 const NotificationSource& source, | 602 const NotificationSource& source, |
599 const NotificationDetails& details) override; | 603 const NotificationDetails& details) override; |
600 | 604 |
601 // NavigationControllerDelegate ---------------------------------------------- | 605 // NavigationControllerDelegate ---------------------------------------------- |
602 | 606 |
603 WebContents* GetWebContents() override; | 607 WebContents* GetWebContents() override; |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
715 CrossSiteIframeAccessibility); | 719 CrossSiteIframeAccessibility); |
716 | 720 |
717 // So InterstitialPageImpl can access SetIsLoading. | 721 // So InterstitialPageImpl can access SetIsLoading. |
718 friend class InterstitialPageImpl; | 722 friend class InterstitialPageImpl; |
719 | 723 |
720 // TODO(brettw) TestWebContents shouldn't exist! | 724 // TODO(brettw) TestWebContents shouldn't exist! |
721 friend class TestWebContents; | 725 friend class TestWebContents; |
722 | 726 |
723 class DestructionObserver; | 727 class DestructionObserver; |
724 | 728 |
729 // Represents a WebContents node in a tree of WebContents structure. | |
730 // | |
731 // Two WebContents with separate FrameTree can be connected by | |
Charlie Reis
2015/05/22 23:44:31
FrameTrees
lazyboy
2015/05/26 16:32:55
Done.
| |
732 // outer/inner relationship using this class. Note that their FrameTrees | |
733 // still remain disjoint/separate. | |
nasko
2015/05/22 16:32:28
nit: Drop the "/separate", one word should be enou
lazyboy
2015/05/26 16:32:55
Done.
| |
734 // The root is referred to as "outer WebContents" and the descendents are | |
nasko
2015/05/22 16:32:27
Where is "root" used?
lazyboy
2015/05/26 16:32:55
I meant the root of this tree structure, not in co
| |
735 // referred to as "inner WebContents". | |
736 struct WebContentsTreeNode { | |
737 public: | |
738 WebContentsTreeNode(); | |
739 ~WebContentsTreeNode(); | |
740 | |
741 void set_parent_web_contents(WebContentsImpl* parent_web_contents) { | |
nasko
2015/05/22 16:32:28
nit: s/parent/outer/ in this entire class.
lazyboy
2015/05/26 16:32:55
Done.
| |
742 parent_web_contents_ = parent_web_contents; | |
743 } | |
744 WebContentsImpl* parent_web_contents() { return parent_web_contents_; } | |
745 | |
746 private: | |
747 WebContentsImpl* parent_web_contents_; | |
748 }; | |
749 | |
725 // See WebContents::Create for a description of these parameters. | 750 // See WebContents::Create for a description of these parameters. |
726 WebContentsImpl(BrowserContext* browser_context, | 751 WebContentsImpl(BrowserContext* browser_context, |
727 WebContentsImpl* opener); | 752 WebContentsImpl* opener); |
728 | 753 |
729 // Add and remove observers for page navigation notifications. The order in | 754 // Add and remove observers for page navigation notifications. The order in |
730 // which notifications are sent to observers is undefined. Clients must be | 755 // which notifications are sent to observers is undefined. Clients must be |
731 // sure to remove the observer before they go away. | 756 // sure to remove the observer before they go away. |
732 void AddObserver(WebContentsObserver* observer); | 757 void AddObserver(WebContentsObserver* observer); |
733 void RemoveObserver(WebContentsObserver* observer); | 758 void RemoveObserver(WebContentsObserver* observer); |
734 | 759 |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1029 scoped_ptr<PowerSaveBlocker> video_power_save_blocker_; | 1054 scoped_ptr<PowerSaveBlocker> video_power_save_blocker_; |
1030 | 1055 |
1031 // Tells whether this WebContents is actively producing sound. | 1056 // Tells whether this WebContents is actively producing sound. |
1032 // Order is important: the |frame_tree_| destruction uses | 1057 // Order is important: the |frame_tree_| destruction uses |
1033 // |audio_state_provider_|. | 1058 // |audio_state_provider_|. |
1034 scoped_ptr<AudioStateProvider> audio_state_provider_; | 1059 scoped_ptr<AudioStateProvider> audio_state_provider_; |
1035 | 1060 |
1036 // 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. |
1037 FrameTree frame_tree_; | 1062 FrameTree frame_tree_; |
1038 | 1063 |
1064 // If this WebContents is part of a "tree of WebContents" structure, then | |
nasko
2015/05/22 16:32:28
nit: Drop one of the usages of "structure. It seem
lazyboy
2015/05/26 16:32:55
Done.
| |
1065 // this contain information about the structure. | |
nasko
2015/05/22 16:32:27
nit: s/contain/contains/
lazyboy
2015/05/26 16:32:55
Done.
| |
1066 WebContentsTreeNode node_; | |
1067 | |
1039 // SavePackage, lazily created. | 1068 // SavePackage, lazily created. |
1040 scoped_refptr<SavePackage> save_package_; | 1069 scoped_refptr<SavePackage> save_package_; |
1041 | 1070 |
1042 // Data for loading state ---------------------------------------------------- | 1071 // Data for loading state ---------------------------------------------------- |
1043 | 1072 |
1044 // Indicates whether we're currently loading a resource. | 1073 // Indicates whether we're currently loading a resource. |
1045 bool is_loading_; | 1074 bool is_loading_; |
1046 | 1075 |
1047 // 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 |
1048 // if is_loading_ is true. | 1077 // if is_loading_ is true. |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1272 // Adds/removes a callback called on creation of each new WebContents. | 1301 // Adds/removes a callback called on creation of each new WebContents. |
1273 static void AddCreatedCallbackForTesting(const CreatedCallback& callback); | 1302 static void AddCreatedCallbackForTesting(const CreatedCallback& callback); |
1274 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback); | 1303 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback); |
1275 | 1304 |
1276 DISALLOW_COPY_AND_ASSIGN(FriendZone); | 1305 DISALLOW_COPY_AND_ASSIGN(FriendZone); |
1277 }; | 1306 }; |
1278 | 1307 |
1279 } // namespace content | 1308 } // namespace content |
1280 | 1309 |
1281 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ | 1310 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ |
OLD | NEW |