| 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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 } | 293 } |
| 294 | 294 |
| 295 void MetricsWebContentsObserver::NavigationStopped() { | 295 void MetricsWebContentsObserver::NavigationStopped() { |
| 296 // TODO(csharrison): Use a more user-initiated signal for STOP. | 296 // TODO(csharrison): Use a more user-initiated signal for STOP. |
| 297 NotifyAbortAllLoads(ABORT_STOP, UserInitiatedInfo::NotUserInitiated()); | 297 NotifyAbortAllLoads(ABORT_STOP, UserInitiatedInfo::NotUserInitiated()); |
| 298 } | 298 } |
| 299 | 299 |
| 300 void MetricsWebContentsObserver::OnInputEvent( | 300 void MetricsWebContentsObserver::OnInputEvent( |
| 301 const blink::WebInputEvent& event) { | 301 const blink::WebInputEvent& event) { |
| 302 // Ignore browser navigation or reload which comes with type Undefined. | 302 // Ignore browser navigation or reload which comes with type Undefined. |
| 303 if (event.type == blink::WebInputEvent::Type::Undefined) | 303 if (event.type() == blink::WebInputEvent::Type::Undefined) |
| 304 return; | 304 return; |
| 305 | 305 |
| 306 if (committed_load_) | 306 if (committed_load_) |
| 307 committed_load_->OnInputEvent(event); | 307 committed_load_->OnInputEvent(event); |
| 308 } | 308 } |
| 309 | 309 |
| 310 void MetricsWebContentsObserver::FlushMetricsOnAppEnterBackground() { | 310 void MetricsWebContentsObserver::FlushMetricsOnAppEnterBackground() { |
| 311 // Signal to observers that we've been backgrounded, in cases where the | 311 // Signal to observers that we've been backgrounded, in cases where the |
| 312 // FlushMetricsOnAppEnterBackground callback gets invoked before the | 312 // FlushMetricsOnAppEnterBackground callback gets invoked before the |
| 313 // associated WasHidden callback. | 313 // associated WasHidden callback. |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 content::NavigationHandle* navigation_handle) const { | 473 content::NavigationHandle* navigation_handle) const { |
| 474 DCHECK(navigation_handle->IsInMainFrame()); | 474 DCHECK(navigation_handle->IsInMainFrame()); |
| 475 DCHECK(!navigation_handle->HasCommitted() || | 475 DCHECK(!navigation_handle->HasCommitted() || |
| 476 !navigation_handle->IsSamePage()); | 476 !navigation_handle->IsSamePage()); |
| 477 | 477 |
| 478 return BrowserPageTrackDecider(embedder_interface_.get(), web_contents(), | 478 return BrowserPageTrackDecider(embedder_interface_.get(), web_contents(), |
| 479 navigation_handle).ShouldTrack(); | 479 navigation_handle).ShouldTrack(); |
| 480 } | 480 } |
| 481 | 481 |
| 482 } // namespace page_load_metrics | 482 } // namespace page_load_metrics |
| OLD | NEW |