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