| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 COMPONENTS_HTML_VIEWER_HTML_FRAME_DELEGATE_H_ | 5 #ifndef COMPONENTS_HTML_VIEWER_HTML_FRAME_DELEGATE_H_ |
| 6 #define COMPONENTS_HTML_VIEWER_HTML_FRAME_DELEGATE_H_ | 6 #define COMPONENTS_HTML_VIEWER_HTML_FRAME_DELEGATE_H_ |
| 7 | 7 |
| 8 namespace mojo { | 8 namespace mojo { |
| 9 class ApplicationImpl; | 9 class Shell; |
| 10 } | 10 } |
| 11 | 11 |
| 12 namespace html_viewer { | 12 namespace html_viewer { |
| 13 | 13 |
| 14 class HTMLFactory; | 14 class HTMLFactory; |
| 15 class HTMLFrame; | 15 class HTMLFrame; |
| 16 | 16 |
| 17 class HTMLFrameDelegate { | 17 class HTMLFrameDelegate { |
| 18 public: | 18 public: |
| 19 // Returns the ApplicationImpl for the frame. | 19 // Returns the Shell for the frame. |
| 20 virtual mojo::ApplicationImpl* GetApp() = 0; | 20 virtual mojo::Shell* GetShell() = 0; |
| 21 | 21 |
| 22 // Returns the factory for creating various classes. | 22 // Returns the factory for creating various classes. |
| 23 virtual HTMLFactory* GetHTMLFactory() = 0; | 23 virtual HTMLFactory* GetHTMLFactory() = 0; |
| 24 | 24 |
| 25 // Invoked when the Frame the delegate is attached to finishes loading. This | 25 // Invoked when the Frame the delegate is attached to finishes loading. This |
| 26 // is not invoked for any child frames, only the frame returned from | 26 // is not invoked for any child frames, only the frame returned from |
| 27 // HTMLFrameTreeManager::CreateFrameAndAttachToTree(). | 27 // HTMLFrameTreeManager::CreateFrameAndAttachToTree(). |
| 28 virtual void OnFrameDidFinishLoad() = 0; | 28 virtual void OnFrameDidFinishLoad() = 0; |
| 29 | 29 |
| 30 // Invoked when the HTMLFrame the delegate is associated with is swapped | 30 // Invoked when the HTMLFrame the delegate is associated with is swapped |
| 31 // to a remote frame. | 31 // to a remote frame. |
| 32 virtual void OnFrameSwappedToRemote() = 0; | 32 virtual void OnFrameSwappedToRemote() = 0; |
| 33 | 33 |
| 34 // Invoked when this delegate is to take over from |old_delegate| (which may | 34 // Invoked when this delegate is to take over from |old_delegate| (which may |
| 35 // be null). This is invoked when a new connection is established and we | 35 // be null). This is invoked when a new connection is established and we |
| 36 // are already rendering to the supplied frame. | 36 // are already rendering to the supplied frame. |
| 37 virtual void OnSwap(HTMLFrame* frame, HTMLFrameDelegate* old_delegate) = 0; | 37 virtual void OnSwap(HTMLFrame* frame, HTMLFrameDelegate* old_delegate) = 0; |
| 38 | 38 |
| 39 // Invoked when the HTMLFrame is destroyed. | 39 // Invoked when the HTMLFrame is destroyed. |
| 40 virtual void OnFrameDestroyed() = 0; | 40 virtual void OnFrameDestroyed() = 0; |
| 41 | 41 |
| 42 protected: | 42 protected: |
| 43 virtual ~HTMLFrameDelegate() {} | 43 virtual ~HTMLFrameDelegate() {} |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 } // namespace html_viewer | 46 } // namespace html_viewer |
| 47 | 47 |
| 48 #endif // COMPONENTS_HTML_VIEWER_HTML_FRAME_DELEGATE_H_ | 48 #endif // COMPONENTS_HTML_VIEWER_HTML_FRAME_DELEGATE_H_ |
| OLD | NEW |