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 MANDOLINE_TAB_FRAME_H_ | 5 #ifndef MANDOLINE_TAB_FRAME_H_ |
6 #define MANDOLINE_TAB_FRAME_H_ | 6 #define MANDOLINE_TAB_FRAME_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 double GatherProgress(int* frame_count) const; | 96 double GatherProgress(int* frame_count) const; |
97 | 97 |
98 private: | 98 private: |
99 friend class FrameTree; | 99 friend class FrameTree; |
100 | 100 |
101 // Initializes the client by sending it the state of the tree. | 101 // Initializes the client by sending it the state of the tree. |
102 void InitClient(); | 102 void InitClient(); |
103 | 103 |
104 void SetView(mojo::View* view); | 104 void SetView(mojo::View* view); |
105 | 105 |
| 106 // Returns the first ancestor (starting at |this|) that has a |
| 107 // FrameTreeClient. |
| 108 Frame* GetAncestorWithFrameTreeClient(); |
| 109 |
106 // Adds this to |frames| and recurses through the children calling the | 110 // Adds this to |frames| and recurses through the children calling the |
107 // same function. | 111 // same function. |
108 void BuildFrameTree(std::vector<const Frame*>* frames) const; | 112 void BuildFrameTree(std::vector<const Frame*>* frames) const; |
109 | 113 |
110 void Add(Frame* node); | 114 void Add(Frame* node); |
111 void Remove(Frame* node); | 115 void Remove(Frame* node); |
112 | 116 |
113 // The implementation of the various FrameTreeServer functions that take | 117 // The implementation of the various FrameTreeServer functions that take |
114 // frame_id call into these. | 118 // frame_id call into these. |
115 void LoadingStartedImpl(); | 119 void LoadingStartedImpl(); |
(...skipping 15 matching lines...) Expand all Loading... |
131 uint32_t change_id); | 135 uint32_t change_id); |
132 void NotifyClientPropertyChanged(const Frame* source, | 136 void NotifyClientPropertyChanged(const Frame* source, |
133 const mojo::String& name, | 137 const mojo::String& name, |
134 const mojo::Array<uint8_t>& value); | 138 const mojo::Array<uint8_t>& value); |
135 | 139 |
136 // mojo::ViewObserver: | 140 // mojo::ViewObserver: |
137 void OnTreeChanged(const TreeChangeParams& params) override; | 141 void OnTreeChanged(const TreeChangeParams& params) override; |
138 void OnViewDestroying(mojo::View* view) override; | 142 void OnViewDestroying(mojo::View* view) override; |
139 | 143 |
140 // FrameTreeServer: | 144 // FrameTreeServer: |
141 void PostMessageEventToFrame(uint32_t frame_id, | 145 void PostMessageEventToFrame(uint32_t source_frame_id, |
142 MessageEventPtr event) override; | 146 uint32_t target_frame_id, |
| 147 HTMLMessageEventPtr event) override; |
143 void LoadingStarted(uint32_t frame_id) override; | 148 void LoadingStarted(uint32_t frame_id) override; |
144 void LoadingStopped(uint32_t frame_id) override; | 149 void LoadingStopped(uint32_t frame_id) override; |
145 void ProgressChanged(uint32_t frame_id, double progress) override; | 150 void ProgressChanged(uint32_t frame_id, double progress) override; |
146 void SetClientProperty(uint32_t frame_id, | 151 void SetClientProperty(uint32_t frame_id, |
147 const mojo::String& name, | 152 const mojo::String& name, |
148 mojo::Array<uint8_t> value) override; | 153 mojo::Array<uint8_t> value) override; |
149 void OnCreatedFrame( | 154 void OnCreatedFrame( |
150 uint32_t parent_id, | 155 uint32_t parent_id, |
151 uint32_t frame_id, | 156 uint32_t frame_id, |
152 mojo::Map<mojo::String, mojo::Array<uint8_t>> client_properties) override; | 157 mojo::Map<mojo::String, mojo::Array<uint8_t>> client_properties) override; |
(...skipping 20 matching lines...) Expand all Loading... |
173 ClientPropertyMap client_properties_; | 178 ClientPropertyMap client_properties_; |
174 | 179 |
175 mojo::Binding<FrameTreeServer> frame_tree_server_binding_; | 180 mojo::Binding<FrameTreeServer> frame_tree_server_binding_; |
176 | 181 |
177 DISALLOW_COPY_AND_ASSIGN(Frame); | 182 DISALLOW_COPY_AND_ASSIGN(Frame); |
178 }; | 183 }; |
179 | 184 |
180 } // namespace mandoline | 185 } // namespace mandoline |
181 | 186 |
182 #endif // MANDOLINE_TAB_FRAME_H_ | 187 #endif // MANDOLINE_TAB_FRAME_H_ |
OLD | NEW |