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 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/time/time.h" |
13 #include "components/mus/public/cpp/types.h" | 14 #include "components/mus/public/cpp/types.h" |
14 #include "components/mus/public/cpp/view_observer.h" | 15 #include "components/mus/public/cpp/view_observer.h" |
15 #include "components/web_view/public/interfaces/frame.mojom.h" | 16 #include "components/web_view/public/interfaces/frame.mojom.h" |
16 #include "third_party/mojo/src/mojo/public/cpp/bindings/binding.h" | 17 #include "third_party/mojo/src/mojo/public/cpp/bindings/binding.h" |
17 | 18 |
18 class GURL; | 19 class GURL; |
19 | 20 |
20 namespace web_view { | 21 namespace web_view { |
21 | 22 |
22 class FrameTest; | 23 class FrameTest; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 uint32_t frame_id, | 62 uint32_t frame_id, |
62 uint32_t app_id, | 63 uint32_t app_id, |
63 ViewOwnership view_ownership, | 64 ViewOwnership view_ownership, |
64 mojom::FrameClient* frame_client, | 65 mojom::FrameClient* frame_client, |
65 scoped_ptr<FrameUserData> user_data, | 66 scoped_ptr<FrameUserData> user_data, |
66 const ClientPropertyMap& client_properties); | 67 const ClientPropertyMap& client_properties); |
67 ~Frame() override; | 68 ~Frame() override; |
68 | 69 |
69 void Init(Frame* parent, | 70 void Init(Frame* parent, |
70 mojo::ViewTreeClientPtr view_tree_client, | 71 mojo::ViewTreeClientPtr view_tree_client, |
71 mojo::InterfaceRequest<mojom::Frame> frame_request); | 72 mojo::InterfaceRequest<mojom::Frame> frame_request, |
| 73 base::TimeTicks navigation_start_time); |
72 | 74 |
73 // Walks the View tree starting at |view| going up returning the first | 75 // Walks the View tree starting at |view| going up returning the first |
74 // Frame that is associated with |view|. For example, if |view| | 76 // Frame that is associated with |view|. For example, if |view| |
75 // has a Frame associated with it, then that is returned. Otherwise | 77 // has a Frame associated with it, then that is returned. Otherwise |
76 // this checks view->parent() and so on. | 78 // this checks view->parent() and so on. |
77 static Frame* FindFirstFrameAncestor(mus::View* view); | 79 static Frame* FindFirstFrameAncestor(mus::View* view); |
78 | 80 |
79 FrameTree* tree() { return tree_; } | 81 FrameTree* tree() { return tree_; } |
80 | 82 |
81 Frame* parent() { return parent_; } | 83 Frame* parent() { return parent_; } |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 | 266 |
265 // StartNavigate() stores the request here if the view isn't available at | 267 // StartNavigate() stores the request here if the view isn't available at |
266 // the time of StartNavigate(). | 268 // the time of StartNavigate(). |
267 mojo::URLRequestPtr pending_navigate_; | 269 mojo::URLRequestPtr pending_navigate_; |
268 | 270 |
269 scoped_ptr<mojo::Binding<mojom::Frame>> frame_binding_; | 271 scoped_ptr<mojo::Binding<mojom::Frame>> frame_binding_; |
270 | 272 |
271 // True if waiting on callback from FrameClient::OnWillNavigate(). | 273 // True if waiting on callback from FrameClient::OnWillNavigate(). |
272 bool waiting_for_on_will_navigate_ack_; | 274 bool waiting_for_on_will_navigate_ack_; |
273 | 275 |
| 276 base::TimeTicks navigation_start_time_; |
| 277 |
274 base::WeakPtrFactory<Frame> embed_weak_ptr_factory_; | 278 base::WeakPtrFactory<Frame> embed_weak_ptr_factory_; |
275 | 279 |
276 base::WeakPtrFactory<Frame> navigate_weak_ptr_factory_; | 280 base::WeakPtrFactory<Frame> navigate_weak_ptr_factory_; |
277 | 281 |
278 DISALLOW_COPY_AND_ASSIGN(Frame); | 282 DISALLOW_COPY_AND_ASSIGN(Frame); |
279 }; | 283 }; |
280 | 284 |
281 } // namespace web_view | 285 } // namespace web_view |
282 | 286 |
283 #endif // COMPONENTS_WEB_VIEW_FRAME_H_ | 287 #endif // COMPONENTS_WEB_VIEW_FRAME_H_ |
OLD | NEW |