| 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_HTML_VIEWER_HTML_FRAME_H_ | 5 #ifndef COMPONENTS_HTML_VIEWER_HTML_FRAME_H_ |
| 6 #define COMPONENTS_HTML_VIEWER_HTML_FRAME_H_ | 6 #define COMPONENTS_HTML_VIEWER_HTML_FRAME_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/time/time.h" |
| 12 #include "cc/layers/surface_layer.h" | 13 #include "cc/layers/surface_layer.h" |
| 13 #include "components/html_viewer/html_frame_tree_manager.h" | 14 #include "components/html_viewer/html_frame_tree_manager.h" |
| 14 #include "components/html_viewer/replicated_frame_state.h" | 15 #include "components/html_viewer/replicated_frame_state.h" |
| 15 #include "components/mus/public/cpp/view_observer.h" | 16 #include "components/mus/public/cpp/view_observer.h" |
| 16 #include "components/web_view/public/interfaces/frame.mojom.h" | 17 #include "components/web_view/public/interfaces/frame.mojom.h" |
| 17 #include "mojo/services/tracing/public/interfaces/tracing.mojom.h" | 18 #include "mojo/services/tracing/public/interfaces/tracing.mojom.h" |
| 18 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 19 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
| 19 #include "third_party/WebKit/public/web/WebFrameClient.h" | 20 #include "third_party/WebKit/public/web/WebFrameClient.h" |
| 20 #include "third_party/WebKit/public/web/WebRemoteFrameClient.h" | 21 #include "third_party/WebKit/public/web/WebRemoteFrameClient.h" |
| 21 #include "third_party/WebKit/public/web/WebSandboxFlags.h" | 22 #include "third_party/WebKit/public/web/WebSandboxFlags.h" |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 // Returns null if the browser side didn't request to setup an agent in this | 141 // Returns null if the browser side didn't request to setup an agent in this |
| 141 // frame. | 142 // frame. |
| 142 DevToolsAgentImpl* devtools_agent() { return devtools_agent_.get(); } | 143 DevToolsAgentImpl* devtools_agent() { return devtools_agent_.get(); } |
| 143 | 144 |
| 144 // Returns true if the Frame is local, false if remote. | 145 // Returns true if the Frame is local, false if remote. |
| 145 bool IsLocal() const; | 146 bool IsLocal() const; |
| 146 | 147 |
| 147 // Returns true if this or one of the frames descendants is local. | 148 // Returns true if this or one of the frames descendants is local. |
| 148 bool HasLocalDescendant() const; | 149 bool HasLocalDescendant() const; |
| 149 | 150 |
| 150 void LoadRequest(const blink::WebURLRequest& request); | 151 void LoadRequest(const blink::WebURLRequest& request, |
| 152 base::TimeTicks navigation_start_time); |
| 151 | 153 |
| 152 protected: | 154 protected: |
| 153 virtual ~HTMLFrame(); | 155 virtual ~HTMLFrame(); |
| 154 | 156 |
| 155 // WebFrameClient methods: | 157 // WebFrameClient methods: |
| 156 virtual blink::WebMediaPlayer* createMediaPlayer( | 158 virtual blink::WebMediaPlayer* createMediaPlayer( |
| 157 blink::WebLocalFrame* frame, | 159 blink::WebLocalFrame* frame, |
| 158 const blink::WebURL& url, | 160 const blink::WebURL& url, |
| 159 blink::WebMediaPlayerClient* client, | 161 blink::WebMediaPlayerClient* client, |
| 160 blink::WebMediaPlayerEncryptedMediaClient* encrypted_client, | 162 blink::WebMediaPlayerEncryptedMediaClient* encrypted_client, |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 void OnViewInputEvent(mus::View* view, const mojo::EventPtr& event) override; | 270 void OnViewInputEvent(mus::View* view, const mojo::EventPtr& event) override; |
| 269 void OnViewFocusChanged(mus::View* gained_focus, | 271 void OnViewFocusChanged(mus::View* gained_focus, |
| 270 mus::View* lost_focus) override; | 272 mus::View* lost_focus) override; |
| 271 | 273 |
| 272 // web_view::mojom::FrameClient: | 274 // web_view::mojom::FrameClient: |
| 273 void OnConnect(web_view::mojom::FramePtr server, | 275 void OnConnect(web_view::mojom::FramePtr server, |
| 274 uint32_t change_id, | 276 uint32_t change_id, |
| 275 uint32_t view_id, | 277 uint32_t view_id, |
| 276 web_view::mojom::ViewConnectType view_connect_type, | 278 web_view::mojom::ViewConnectType view_connect_type, |
| 277 mojo::Array<web_view::mojom::FrameDataPtr> frame_data, | 279 mojo::Array<web_view::mojom::FrameDataPtr> frame_data, |
| 280 int64_t navigation_start_time_ticks, |
| 278 const OnConnectCallback& callback) override; | 281 const OnConnectCallback& callback) override; |
| 279 void OnFrameAdded(uint32_t change_id, | 282 void OnFrameAdded(uint32_t change_id, |
| 280 web_view::mojom::FrameDataPtr frame_data) override; | 283 web_view::mojom::FrameDataPtr frame_data) override; |
| 281 void OnFrameRemoved(uint32_t change_id, uint32_t frame_id) override; | 284 void OnFrameRemoved(uint32_t change_id, uint32_t frame_id) override; |
| 282 void OnFrameClientPropertyChanged(uint32_t frame_id, | 285 void OnFrameClientPropertyChanged(uint32_t frame_id, |
| 283 const mojo::String& name, | 286 const mojo::String& name, |
| 284 mojo::Array<uint8_t> new_value) override; | 287 mojo::Array<uint8_t> new_value) override; |
| 285 void OnPostMessageEvent( | 288 void OnPostMessageEvent( |
| 286 uint32_t source_frame_id, | 289 uint32_t source_frame_id, |
| 287 uint32_t target_frame_id, | 290 uint32_t target_frame_id, |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 // This object is only valid in the context of performance tests. | 353 // This object is only valid in the context of performance tests. |
| 351 tracing::StartupPerformanceDataCollectorPtr | 354 tracing::StartupPerformanceDataCollectorPtr |
| 352 startup_performance_data_collector_; | 355 startup_performance_data_collector_; |
| 353 | 356 |
| 354 scoped_ptr<DevToolsAgentImpl> devtools_agent_; | 357 scoped_ptr<DevToolsAgentImpl> devtools_agent_; |
| 355 | 358 |
| 356 // A navigation request has been sent to the frame server side, and we haven't | 359 // A navigation request has been sent to the frame server side, and we haven't |
| 357 // received response to it. | 360 // received response to it. |
| 358 bool pending_navigation_; | 361 bool pending_navigation_; |
| 359 | 362 |
| 363 base::TimeTicks navigation_start_time_; |
| 364 |
| 360 base::WeakPtrFactory<HTMLFrame> weak_factory_; | 365 base::WeakPtrFactory<HTMLFrame> weak_factory_; |
| 361 | 366 |
| 362 DISALLOW_COPY_AND_ASSIGN(HTMLFrame); | 367 DISALLOW_COPY_AND_ASSIGN(HTMLFrame); |
| 363 }; | 368 }; |
| 364 | 369 |
| 365 } // namespace html_viewer | 370 } // namespace html_viewer |
| 366 | 371 |
| 367 #endif // COMPONENTS_HTML_VIEWER_HTML_FRAME_H_ | 372 #endif // COMPONENTS_HTML_VIEWER_HTML_FRAME_H_ |
| OLD | NEW |