Roll src/third_party/WebKit eac3800:0237a66 (svn 202606:202607)
[chromium-blink-merge.git] / components / html_viewer / html_frame_delegate.h
blob9418aa61dbdf81cacce2da33b05bc628317a6297
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
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_HTML_VIEWER_HTML_FRAME_DELEGATE_H_
6 #define COMPONENTS_HTML_VIEWER_HTML_FRAME_DELEGATE_H_
8 namespace mojo {
9 class ApplicationImpl;
12 namespace html_viewer {
14 class HTMLFactory;
15 class HTMLFrame;
17 class HTMLFrameDelegate {
18 public:
19 // Returns the ApplicationImpl for the frame.
20 virtual mojo::ApplicationImpl* GetApp() = 0;
22 // Returns the factory for creating various classes.
23 virtual HTMLFactory* GetHTMLFactory() = 0;
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
27 // HTMLFrameTreeManager::CreateFrameAndAttachToTree().
28 virtual void OnFrameDidFinishLoad() = 0;
30 // Invoked when the HTMLFrame the delegate is associated with is swapped
31 // to a remote frame.
32 virtual void OnFrameSwappedToRemote() = 0;
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
36 // are already rendering to the supplied frame.
37 virtual void OnSwap(HTMLFrame* frame, HTMLFrameDelegate* old_delegate) = 0;
39 // Invoked when the HTMLFrame is destroyed.
40 virtual void OnFrameDestroyed() = 0;
42 protected:
43 virtual ~HTMLFrameDelegate() {}
46 } // namespace html_viewer
48 #endif // COMPONENTS_HTML_VIEWER_HTML_FRAME_DELEGATE_H_