summaryrefslogtreecommitdiffstats
path: root/components/html_viewer/html_frame_delegate.h
blob: 1161138b2d30ee3282b8070c566f692e0f9356b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_HTML_VIEWER_HTML_FRAME_DELEGATE_H_
#define COMPONENTS_HTML_VIEWER_HTML_FRAME_DELEGATE_H_

#include "components/html_viewer/html_frame.h"

namespace mojo {
class ApplicationImpl;
}

namespace html_viewer {

class HTMLFrameDelegate {
 public:
  // TODO(yzshen): Remove this check once the browser is able to navigate an
  // existing html_viewer instance and about:blank page support is ready.
  virtual bool ShouldNavigateLocallyInMainFrame() = 0;

  // Invoked when the Frame the delegate is attached to finishes loading. This
  // is not invoked for any child frames, only the frame returned from
  // HTMLFrameTreeManager::CreateFrameAndAttachToTree().
  virtual void OnFrameDidFinishLoad() = 0;

  // Returns the ApplicationImpl for the frame.
  virtual mojo::ApplicationImpl* GetApp() = 0;

  // Creates a new HTMLFrame. The delegate must return non-null.
  virtual HTMLFrame* CreateHTMLFrame(HTMLFrame::CreateParams* params) = 0;

  // Invoked when the HTMLFrame the delegate is associated with is swapped
  // to a remote frame.
  virtual void OnFrameSwappedToRemote() = 0;

 protected:
  virtual ~HTMLFrameDelegate() {}
};

}  // namespace html_viewer

#endif  // COMPONENTS_HTML_VIEWER_HTML_FRAME_DELEGATE_H_