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 #include "chrome/browser/page_load_metrics/metrics_web_contents_observer.h" | 5 #include "chrome/browser/page_load_metrics/metrics_web_contents_observer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <ostream> | 8 #include <ostream> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 if (embedder_interface_->IsPrerendering( | 318 if (embedder_interface_->IsPrerendering( |
319 navigation_handle->GetWebContents())) { | 319 navigation_handle->GetWebContents())) { |
320 DCHECK(!started_in_foreground_); | 320 DCHECK(!started_in_foreground_); |
321 // For the time being, we do not track prerenders. See crbug.com/648338 for | 321 // For the time being, we do not track prerenders. See crbug.com/648338 for |
322 // details. | 322 // details. |
323 StopTracking(); | 323 StopTracking(); |
324 return; | 324 return; |
325 } | 325 } |
326 | 326 |
327 embedder_interface_->RegisterObservers(this); | 327 embedder_interface_->RegisterObservers(this); |
328 for (const auto& observer : observers_) { | 328 INVOKE_AND_PRUNE_OBSERVERS(observers_, OnStart, navigation_handle, |
329 observer->OnStart(navigation_handle, currently_committed_url, | 329 currently_committed_url, started_in_foreground_); |
330 started_in_foreground_); | |
331 } | |
332 } | 330 } |
333 | 331 |
334 PageLoadTracker::~PageLoadTracker() { | 332 PageLoadTracker::~PageLoadTracker() { |
335 if (app_entered_background_) { | 333 if (app_entered_background_) { |
336 RecordAppBackgroundPageLoadCompleted(true); | 334 RecordAppBackgroundPageLoadCompleted(true); |
337 } | 335 } |
338 | 336 |
339 if (did_stop_tracking_) | 337 if (did_stop_tracking_) |
340 return; | 338 return; |
341 | 339 |
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1094 content::NavigationHandle* navigation_handle) const { | 1092 content::NavigationHandle* navigation_handle) const { |
1095 DCHECK(navigation_handle->IsInMainFrame()); | 1093 DCHECK(navigation_handle->IsInMainFrame()); |
1096 DCHECK(!navigation_handle->HasCommitted() || | 1094 DCHECK(!navigation_handle->HasCommitted() || |
1097 !navigation_handle->IsSamePage()); | 1095 !navigation_handle->IsSamePage()); |
1098 | 1096 |
1099 return BrowserPageTrackDecider(embedder_interface_.get(), web_contents(), | 1097 return BrowserPageTrackDecider(embedder_interface_.get(), web_contents(), |
1100 navigation_handle).ShouldTrack(); | 1098 navigation_handle).ShouldTrack(); |
1101 } | 1099 } |
1102 | 1100 |
1103 } // namespace page_load_metrics | 1101 } // namespace page_load_metrics |
OLD | NEW |