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 module mandoline; | 5 module mandoline; |
6 | 6 |
7 // This files defines the interfaces and structures used for frames. | 7 // This files defines the interfaces and structures used for frames. |
8 // | 8 // |
9 // When a client in the frame tree is connected to by way of the ViewManager a | 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 | 10 // FrameTreeClient is obtained (from the ServiceProvider interface request |
11 // passed in ViewManager::OnEmbed()). The FrameTreeClient is told the frame | 11 // passed in ViewManager::OnEmbed()). The FrameTreeClient is told the frame |
12 // tree (by way of OnConnection()), which allows the client to use other | 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). | 13 // frames in the tree (assuming the client has the appropriate permissions). |
14 // | 14 // |
15 // frame_ids are the same as views ids. This means that when a client creates | 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 | 16 // a new view to be part of the frame tree it immediately knows the id to use |
17 // for FrameTreeServer calls. | 17 // for FrameTreeServer calls. |
18 // TODO(sky): there are likely timing issues here, figure out how to resolve | 18 // TODO(sky): there are likely timing issues here, figure out how to resolve |
19 // that. | 19 // that. |
20 | 20 |
21 // Provides information about a frame. | 21 // Provides information about a frame. |
22 struct FrameData { | 22 struct FrameData { |
23 // 0 if the frame has no parent (its the root). | 23 // 0 if the frame has no parent (its the root). |
24 uint32 parent_id; | 24 uint32 parent_id; |
25 uint32 frame_id; | 25 uint32 frame_id; |
| 26 |
| 27 string? name; |
| 28 // TODO(sky): this is not being propagated correctly. It needs to be updated |
| 29 // along with deciding if we want to keep NavigatorHost. |
| 30 string origin; |
| 31 uint32 sandbox_flags; |
26 }; | 32 }; |
27 | 33 |
28 struct MessageEvent { | 34 struct MessageEvent { |
29 // TODO(sky): add details. | 35 // TODO(sky): add details. |
30 }; | 36 }; |
31 | 37 |
32 interface FrameTreeServer { | 38 interface FrameTreeServer { |
33 // TODO(sky): make these real. | 39 // TODO(sky): make these real. |
34 PostMessageEventToFrame(uint32 frame_id, MessageEvent event); | 40 PostMessageEventToFrame(uint32 frame_id, MessageEvent event); |
35 NavigateFrame(uint32 frame_id); | 41 NavigateFrame(uint32 frame_id); |
36 ReloadFrame(uint32 frame_id); | 42 ReloadFrame(uint32 frame_id); |
37 | 43 |
38 // Notifies the server that a load has started or stopped in this frame. | 44 // 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 | 45 // When loading is started, progress is reset to 0, but when loading is |
40 // stopped progress may not have reached 1.0. | 46 // stopped progress may not have reached 1.0. |
41 LoadingStarted(); | 47 LoadingStarted(); |
42 LoadingStopped(); | 48 LoadingStopped(); |
43 | 49 |
44 // Called when the progress for this frame changes. Will only be called while | 50 // Called when the progress for this frame changes. Will only be called while |
45 // a load is in progress. | 51 // a load is in progress. |
46 ProgressChanged(double progress); | 52 ProgressChanged(double progress); |
| 53 |
| 54 SetFrameName(string? name); |
47 }; | 55 }; |
48 | 56 |
49 interface FrameTreeClient { | 57 interface FrameTreeClient { |
50 // Called once per client. |frame_data| gives the contents of the tree. | 58 // Called once per client. |frame_data| gives the contents of the tree. |
51 OnConnect(FrameTreeServer server, array<FrameData> frame_data); | 59 OnConnect(FrameTreeServer server, array<FrameData> frame_data); |
52 | 60 |
53 // Called when a new frame is added to the tree. This is not called on the | 61 // Called when a new frame is added to the tree. This is not called on the |
54 // originator of the change. | 62 // originator of the change. |
55 OnFrameAdded(FrameData frame_data); | 63 OnFrameAdded(FrameData frame_data); |
56 | 64 |
57 // Called when a frame is removed from the tree. This is not called on the | 65 // Called when a frame is removed from the tree. This is not called on the |
58 // originator of the change. | 66 // originator of the change. |
59 OnFrameRemoved(uint32 frame_id); | 67 OnFrameRemoved(uint32 frame_id); |
| 68 |
| 69 // Called when the name of a frame changes. This is not called on the |
| 70 // originator of the change. |
| 71 OnFrameNameChanged(uint32 frame_id, string name); |
60 }; | 72 }; |
OLD | NEW |