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 COMPONENTS_WEB_VIEW_FRAME_H_ | 5 #ifndef COMPONENTS_WEB_VIEW_FRAME_H_ |
6 #define COMPONENTS_WEB_VIEW_FRAME_H_ | 6 #define COMPONENTS_WEB_VIEW_FRAME_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 105 |
106 const std::vector<Frame*>& children() const { return children_; } | 106 const std::vector<Frame*>& children() const { return children_; } |
107 | 107 |
108 // Returns true if this Frame or any child Frame is loading. | 108 // Returns true if this Frame or any child Frame is loading. |
109 bool IsLoading() const; | 109 bool IsLoading() const; |
110 | 110 |
111 // Returns the sum total of loading progress from this Frame and all of its | 111 // Returns the sum total of loading progress from this Frame and all of its |
112 // children, as well as the number of Frames accumulated. | 112 // children, as well as the number of Frames accumulated. |
113 double GatherProgress(int* frame_count) const; | 113 double GatherProgress(int* frame_count) const; |
114 | 114 |
| 115 void Find(int32_t request_id, const mojo::String& search_text); |
| 116 void StopFinding(); |
| 117 |
115 private: | 118 private: |
116 friend class FrameTest; | 119 friend class FrameTest; |
117 friend class FrameTree; | 120 friend class FrameTree; |
118 | 121 |
119 // Identifies whether the FrameClient is from the same app or a different | 122 // Identifies whether the FrameClient is from the same app or a different |
120 // app. | 123 // app. |
121 enum class ClientType { | 124 enum class ClientType { |
122 // The client is either the root frame, or navigating an existing frame | 125 // The client is either the root frame, or navigating an existing frame |
123 // to a different app. | 126 // to a different app. |
124 EXISTING_FRAME_NEW_APP, | 127 EXISTING_FRAME_NEW_APP, |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 void OnCreatedFrame( | 220 void OnCreatedFrame( |
218 mojo::InterfaceRequest<mojom::Frame> frame_request, | 221 mojo::InterfaceRequest<mojom::Frame> frame_request, |
219 mojom::FrameClientPtr client, | 222 mojom::FrameClientPtr client, |
220 uint32_t frame_id, | 223 uint32_t frame_id, |
221 mojo::Map<mojo::String, mojo::Array<uint8_t>> client_properties) override; | 224 mojo::Map<mojo::String, mojo::Array<uint8_t>> client_properties) override; |
222 void RequestNavigate(mojom::NavigationTargetType target_type, | 225 void RequestNavigate(mojom::NavigationTargetType target_type, |
223 uint32_t target_frame_id, | 226 uint32_t target_frame_id, |
224 mojo::URLRequestPtr request) override; | 227 mojo::URLRequestPtr request) override; |
225 void DidNavigateLocally(const mojo::String& url) override; | 228 void DidNavigateLocally(const mojo::String& url) override; |
226 void DispatchLoadEventToParent() override; | 229 void DispatchLoadEventToParent() override; |
| 230 void ReportFindInPageMatchCount(int32_t request_id, |
| 231 int32_t count, |
| 232 bool final_update) override; |
| 233 void ReportFindInPageSelection(int32_t request_id, |
| 234 int32_t active_match_ordinal) override; |
227 | 235 |
228 FrameTree* const tree_; | 236 FrameTree* const tree_; |
229 // WARNING: this may be null. See class description for details. | 237 // WARNING: this may be null. See class description for details. |
230 mus::View* view_; | 238 mus::View* view_; |
231 // The connection id returned from ViewManager::Embed(). Frames created by | 239 // The connection id returned from ViewManager::Embed(). Frames created by |
232 // way of OnCreatedFrame() inherit the id from the parent. | 240 // way of OnCreatedFrame() inherit the id from the parent. |
233 mus::ConnectionSpecificId embedded_connection_id_; | 241 mus::ConnectionSpecificId embedded_connection_id_; |
234 // ID for the frame, which is the same as that of the view. | 242 // ID for the frame, which is the same as that of the view. |
235 const uint32_t id_; | 243 const uint32_t id_; |
236 // ID of the app providing the FrameClient and ViewTreeClient. | 244 // ID of the app providing the FrameClient and ViewTreeClient. |
(...skipping 22 matching lines...) Expand all Loading... |
259 base::WeakPtrFactory<Frame> embed_weak_ptr_factory_; | 267 base::WeakPtrFactory<Frame> embed_weak_ptr_factory_; |
260 | 268 |
261 base::WeakPtrFactory<Frame> navigate_weak_ptr_factory_; | 269 base::WeakPtrFactory<Frame> navigate_weak_ptr_factory_; |
262 | 270 |
263 DISALLOW_COPY_AND_ASSIGN(Frame); | 271 DISALLOW_COPY_AND_ASSIGN(Frame); |
264 }; | 272 }; |
265 | 273 |
266 } // namespace web_view | 274 } // namespace web_view |
267 | 275 |
268 #endif // COMPONENTS_WEB_VIEW_FRAME_H_ | 276 #endif // COMPONENTS_WEB_VIEW_FRAME_H_ |
OLD | NEW |