| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include "blimp/engine/session/page_load_tracker.h" | 5 #include "blimp/engine/session/page_load_tracker.h" |
| 6 | 6 |
| 7 #include "content/public/browser/render_widget_host_view.h" | 7 #include "content/public/browser/render_widget_host_view.h" |
| 8 | 8 |
| 9 namespace blimp { | 9 namespace blimp { |
| 10 namespace engine { | 10 namespace engine { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 : client_(client) { | 26 : client_(client) { |
| 27 DCHECK(web_contents); | 27 DCHECK(web_contents); |
| 28 Observe(web_contents); | 28 Observe(web_contents); |
| 29 } | 29 } |
| 30 | 30 |
| 31 PageLoadTracker::~PageLoadTracker() {} | 31 PageLoadTracker::~PageLoadTracker() {} |
| 32 | 32 |
| 33 void PageLoadTracker::DidStartProvisionalLoadForFrame( | 33 void PageLoadTracker::DidStartProvisionalLoadForFrame( |
| 34 content::RenderFrameHost* render_frame_host, | 34 content::RenderFrameHost* render_frame_host, |
| 35 const GURL& validated_url, | 35 const GURL& validated_url, |
| 36 bool is_error_page, | 36 bool is_error_page) { |
| 37 bool is_iframe_srcdoc) { | |
| 38 content::RenderWidgetHost* render_widget_host = | 37 content::RenderWidgetHost* render_widget_host = |
| 39 GetRenderWidgetHostIfMainFrame(render_frame_host); | 38 GetRenderWidgetHostIfMainFrame(render_frame_host); |
| 40 if (!render_widget_host) | 39 if (!render_widget_host) |
| 41 return; | 40 return; |
| 42 | 41 |
| 43 render_widget_load_status_[render_widget_host] = LoadStatus(); | 42 render_widget_load_status_[render_widget_host] = LoadStatus(); |
| 44 | 43 |
| 45 // Notify the client that a navigation was initiated. | 44 // Notify the client that a navigation was initiated. |
| 46 client_->SendPageLoadStatusUpdate(PageLoadStatus::LOADING); | 45 client_->SendPageLoadStatusUpdate(PageLoadStatus::LOADING); |
| 47 } | 46 } |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 render_widget_load_status_.erase(it); | 94 render_widget_load_status_.erase(it); |
| 96 } | 95 } |
| 97 } | 96 } |
| 98 | 97 |
| 99 bool PageLoadTracker::LoadStatus::Loaded() const { | 98 bool PageLoadTracker::LoadStatus::Loaded() const { |
| 100 return page_loaded && did_first_paint; | 99 return page_loaded && did_first_paint; |
| 101 } | 100 } |
| 102 | 101 |
| 103 } // namespace engine | 102 } // namespace engine |
| 104 } // namespace blimp | 103 } // namespace blimp |
| OLD | NEW |