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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 273 bool IsCrashed() const override; | 273 bool IsCrashed() const override; | 
| 274 void SetIsCrashed(base::TerminationStatus status, int error_code) override; | 274 void SetIsCrashed(base::TerminationStatus status, int error_code) override; | 
| 275 base::TerminationStatus GetCrashedStatus() const override; | 275 base::TerminationStatus GetCrashedStatus() const override; | 
| 276 bool IsBeingDestroyed() const override; | 276 bool IsBeingDestroyed() const override; | 
| 277 void NotifyNavigationStateChanged(InvalidateTypes changed_flags) override; | 277 void NotifyNavigationStateChanged(InvalidateTypes changed_flags) override; | 
| 278 base::Time GetLastActiveTime() const override; | 278 base::Time GetLastActiveTime() const override; | 
| 279 void WasShown() override; | 279 void WasShown() override; | 
| 280 void WasHidden() override; | 280 void WasHidden() override; | 
| 281 bool NeedToFireBeforeUnload() override; | 281 bool NeedToFireBeforeUnload() override; | 
| 282 void DispatchBeforeUnload(bool for_cross_site_transition) override; | 282 void DispatchBeforeUnload(bool for_cross_site_transition) override; | 
| 283 void AttachToEmbedderFrame(WebContents* embedder_web_contents, | |
| 284 RenderFrameHost* embedder_frame) override; | |
| 283 void Stop() override; | 285 void Stop() override; | 
| 284 WebContents* Clone() override; | 286 WebContents* Clone() override; | 
| 285 void ReloadFocusedFrame(bool ignore_cache) override; | 287 void ReloadFocusedFrame(bool ignore_cache) override; | 
| 286 void Undo() override; | 288 void Undo() override; | 
| 287 void Redo() override; | 289 void Redo() override; | 
| 288 void Cut() override; | 290 void Cut() override; | 
| 289 void Copy() override; | 291 void Copy() override; | 
| 290 void CopyToFindPboard() override; | 292 void CopyToFindPboard() override; | 
| 291 void Paste() override; | 293 void Paste() override; | 
| 292 void PasteAndMatchStyle() override; | 294 void PasteAndMatchStyle() override; | 
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 593 void NotifyMainFrameSwappedFromRenderManager( | 595 void NotifyMainFrameSwappedFromRenderManager( | 
| 594 RenderViewHost* old_host, | 596 RenderViewHost* old_host, | 
| 595 RenderViewHost* new_host) override; | 597 RenderViewHost* new_host) override; | 
| 596 int CreateOpenerRenderViewsForRenderManager(SiteInstance* instance) override; | 598 int CreateOpenerRenderViewsForRenderManager(SiteInstance* instance) override; | 
| 597 NavigationControllerImpl& GetControllerForRenderManager() override; | 599 NavigationControllerImpl& GetControllerForRenderManager() override; | 
| 598 scoped_ptr<WebUIImpl> CreateWebUIForRenderManager(const GURL& url) override; | 600 scoped_ptr<WebUIImpl> CreateWebUIForRenderManager(const GURL& url) override; | 
| 599 NavigationEntry* GetLastCommittedNavigationEntryForRenderManager() override; | 601 NavigationEntry* GetLastCommittedNavigationEntryForRenderManager() override; | 
| 600 bool FocusLocationBarByDefault() override; | 602 bool FocusLocationBarByDefault() override; | 
| 601 void SetFocusToLocationBar(bool select_all) override; | 603 void SetFocusToLocationBar(bool select_all) override; | 
| 602 bool IsHidden() override; | 604 bool IsHidden() override; | 
| 605 int64 GetEmbedderFrameTreeNodeID() override; | |
| 603 | 606 | 
| 604 // NotificationObserver ------------------------------------------------------ | 607 // NotificationObserver ------------------------------------------------------ | 
| 605 | 608 | 
| 606 void Observe(int type, | 609 void Observe(int type, | 
| 607 const NotificationSource& source, | 610 const NotificationSource& source, | 
| 608 const NotificationDetails& details) override; | 611 const NotificationDetails& details) override; | 
| 609 | 612 | 
| 610 // NavigationControllerDelegate ---------------------------------------------- | 613 // NavigationControllerDelegate ---------------------------------------------- | 
| 611 | 614 | 
| 612 WebContents* GetWebContents() override; | 615 WebContents* GetWebContents() override; | 
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 728 CrossSiteIframeAccessibility); | 731 CrossSiteIframeAccessibility); | 
| 729 | 732 | 
| 730 // So InterstitialPageImpl can access SetIsLoading. | 733 // So InterstitialPageImpl can access SetIsLoading. | 
| 731 friend class InterstitialPageImpl; | 734 friend class InterstitialPageImpl; | 
| 732 | 735 | 
| 733 // TODO(brettw) TestWebContents shouldn't exist! | 736 // TODO(brettw) TestWebContents shouldn't exist! | 
| 734 friend class TestWebContents; | 737 friend class TestWebContents; | 
| 735 | 738 | 
| 736 class DestructionObserver; | 739 class DestructionObserver; | 
| 737 | 740 | 
| 741 // Represents a WebContents node in a tree of WebContents structure. | |
| 742 // | |
| 743 // Two WebContents with separate FrameTree can be connected by | |
| 744 // parent-child relationship using this class. Note that their FrameTrees | |
| 
 
Charlie Reis
2015/05/19 07:12:31
outer/inner
 
lazyboy
2015/05/21 23:23:47
Done, please check.
 
 | |
| 745 // still remain disjoint/separate. | |
| 746 struct WebContentsTreeNode { | |
| 747 public: | |
| 748 WebContentsTreeNode(); | |
| 749 ~WebContentsTreeNode(); | |
| 750 | |
| 751 void set_parent_web_contents(WebContentsImpl* parent_web_contents) { | |
| 752 parent_web_contents_ = parent_web_contents; | |
| 753 } | |
| 754 WebContentsImpl* parent_web_contents() { return parent_web_contents_; } | |
| 755 | |
| 756 private: | |
| 757 WebContentsImpl* parent_web_contents_; | |
| 758 }; | |
| 759 | |
| 738 // See WebContents::Create for a description of these parameters. | 760 // See WebContents::Create for a description of these parameters. | 
| 739 WebContentsImpl(BrowserContext* browser_context, | 761 WebContentsImpl(BrowserContext* browser_context, | 
| 740 WebContentsImpl* opener); | 762 WebContentsImpl* opener); | 
| 741 | 763 | 
| 742 // Add and remove observers for page navigation notifications. The order in | 764 // Add and remove observers for page navigation notifications. The order in | 
| 743 // which notifications are sent to observers is undefined. Clients must be | 765 // which notifications are sent to observers is undefined. Clients must be | 
| 744 // sure to remove the observer before they go away. | 766 // sure to remove the observer before they go away. | 
| 745 void AddObserver(WebContentsObserver* observer); | 767 void AddObserver(WebContentsObserver* observer); | 
| 746 void RemoveObserver(WebContentsObserver* observer); | 768 void RemoveObserver(WebContentsObserver* observer); | 
| 747 | 769 | 
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1042 scoped_ptr<PowerSaveBlocker> video_power_save_blocker_; | 1064 scoped_ptr<PowerSaveBlocker> video_power_save_blocker_; | 
| 1043 | 1065 | 
| 1044 // Tells whether this WebContents is actively producing sound. | 1066 // Tells whether this WebContents is actively producing sound. | 
| 1045 // Order is important: the |frame_tree_| destruction uses | 1067 // Order is important: the |frame_tree_| destruction uses | 
| 1046 // |audio_state_provider_|. | 1068 // |audio_state_provider_|. | 
| 1047 scoped_ptr<AudioStateProvider> audio_state_provider_; | 1069 scoped_ptr<AudioStateProvider> audio_state_provider_; | 
| 1048 | 1070 | 
| 1049 // Manages the frame tree of the page and process swaps in each node. | 1071 // Manages the frame tree of the page and process swaps in each node. | 
| 1050 FrameTree frame_tree_; | 1072 FrameTree frame_tree_; | 
| 1051 | 1073 | 
| 1074 // If this WebContents is part of a "tree of WebContents" structure, then | |
| 1075 // this contain information about the structure. | |
| 1076 WebContentsTreeNode node_; | |
| 1077 | |
| 1052 // SavePackage, lazily created. | 1078 // SavePackage, lazily created. | 
| 1053 scoped_refptr<SavePackage> save_package_; | 1079 scoped_refptr<SavePackage> save_package_; | 
| 1054 | 1080 | 
| 1055 // Data for loading state ---------------------------------------------------- | 1081 // Data for loading state ---------------------------------------------------- | 
| 1056 | 1082 | 
| 1057 // Indicates whether we're currently loading a resource. | 1083 // Indicates whether we're currently loading a resource. | 
| 1058 bool is_loading_; | 1084 bool is_loading_; | 
| 1059 | 1085 | 
| 1060 // Indicates whether the current load is to a different document. Only valid | 1086 // Indicates whether the current load is to a different document. Only valid | 
| 1061 // if is_loading_ is true. | 1087 // if is_loading_ is true. | 
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1285 // Adds/removes a callback called on creation of each new WebContents. | 1311 // Adds/removes a callback called on creation of each new WebContents. | 
| 1286 static void AddCreatedCallbackForTesting(const CreatedCallback& callback); | 1312 static void AddCreatedCallbackForTesting(const CreatedCallback& callback); | 
| 1287 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback); | 1313 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback); | 
| 1288 | 1314 | 
| 1289 DISALLOW_COPY_AND_ASSIGN(FriendZone); | 1315 DISALLOW_COPY_AND_ASSIGN(FriendZone); | 
| 1290 }; | 1316 }; | 
| 1291 | 1317 | 
| 1292 } // namespace content | 1318 } // namespace content | 
| 1293 | 1319 | 
| 1294 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ | 1320 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ | 
| OLD | NEW |