Add P2PDatagramSocket and P2PStreamSocket interfaces.
[chromium-blink-merge.git] / mandoline / tab / public / interfaces / frame_tree.mojom
blob0582fe57629317ab0feb0badc48ebaa5321a94ee
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 module mandoline;
7 // This files defines the interfaces and structures used for frames.
8 //
9 // When a client in the frame tree is connected to by way of the ViewManager a
10 // FrameTreeClient is obtained (from the ServiceProvider interface request
11 // passed in ViewManager::OnEmbed()). The FrameTreeClient is told the frame
12 // tree (by way of OnConnection()), which allows the client to use other
13 // frames in the tree (assuming the client has the appropriate permissions).
15 // frame_ids are the same as views ids. This means that when a client creates
16 // a new view to be part of the frame tree it immediately knows the id to use
17 // for FrameTreeServer calls.
18 // TODO(sky): there are likely timing issues here, figure out how to resolve
19 // that.
21 // Provides information about a frame.
22 struct FrameData {
23   // 0 if the frame has no parent (its the root).
24   uint32 parent_id;
25   uint32 frame_id;
28 struct MessageEvent {
29   // TODO(sky): add details.
32 interface FrameTreeServer {
33   // TODO(sky): make these real.
34   PostMessageEventToFrame(uint32 frame_id, MessageEvent event);
35   NavigateFrame(uint32 frame_id);
36   ReloadFrame(uint32 frame_id);
38   // Notifies the server that a load has started or stopped in this frame.
39   // When loading is started, progress is reset to 0, but when loading is
40   // stopped progress may not have reached 1.0.
41   LoadingStarted();
42   LoadingStopped();
44   // Called when the progress for this frame changes. Will only be called while
45   // a load is in progress.
46   ProgressChanged(double progress);
49 interface FrameTreeClient {
50   // Called once per client. |frame_data| gives the contents of the tree.
51   OnConnect(FrameTreeServer server, array<FrameData> frame_data);
53   // Called when a new frame is added to the tree. This is not called on the
54   // originator of the change.
55   OnFrameAdded(FrameData frame_data);
57   // Called when a frame is removed from the tree. This is not called on the
58   // originator of the change.
59   OnFrameRemoved(uint32 frame_id);