| 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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 } | 302 } |
| 303 | 303 |
| 304 void MetricsWebContentsObserver::NavigationStopped() { | 304 void MetricsWebContentsObserver::NavigationStopped() { |
| 305 // TODO(csharrison): Use a more user-initiated signal for STOP. | 305 // TODO(csharrison): Use a more user-initiated signal for STOP. |
| 306 NotifyAbortAllLoads(ABORT_STOP, UserInitiatedInfo::NotUserInitiated()); | 306 NotifyAbortAllLoads(ABORT_STOP, UserInitiatedInfo::NotUserInitiated()); |
| 307 } | 307 } |
| 308 | 308 |
| 309 void MetricsWebContentsObserver::OnInputEvent( | 309 void MetricsWebContentsObserver::OnInputEvent( |
| 310 const blink::WebInputEvent& event) { | 310 const blink::WebInputEvent& event) { |
| 311 // Ignore browser navigation or reload which comes with type Undefined. | 311 // Ignore browser navigation or reload which comes with type Undefined. |
| 312 if (event.type == blink::WebInputEvent::Type::Undefined) | 312 if (event.type() == blink::WebInputEvent::Type::Undefined) |
| 313 return; | 313 return; |
| 314 | 314 |
| 315 if (committed_load_) | 315 if (committed_load_) |
| 316 committed_load_->OnInputEvent(event); | 316 committed_load_->OnInputEvent(event); |
| 317 } | 317 } |
| 318 | 318 |
| 319 void MetricsWebContentsObserver::FlushMetricsOnAppEnterBackground() { | 319 void MetricsWebContentsObserver::FlushMetricsOnAppEnterBackground() { |
| 320 // Note that, while a call to FlushMetricsOnAppEnterBackground usually | 320 // Note that, while a call to FlushMetricsOnAppEnterBackground usually |
| 321 // indicates that the app is about to be backgrounded, there are cases where | 321 // indicates that the app is about to be backgrounded, there are cases where |
| 322 // the app may not end up getting backgrounded. Thus, we should not assume | 322 // the app may not end up getting backgrounded. Thus, we should not assume |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 content::NavigationHandle* navigation_handle) const { | 483 content::NavigationHandle* navigation_handle) const { |
| 484 DCHECK(navigation_handle->IsInMainFrame()); | 484 DCHECK(navigation_handle->IsInMainFrame()); |
| 485 DCHECK(!navigation_handle->HasCommitted() || | 485 DCHECK(!navigation_handle->HasCommitted() || |
| 486 !navigation_handle->IsSamePage()); | 486 !navigation_handle->IsSamePage()); |
| 487 | 487 |
| 488 return BrowserPageTrackDecider(embedder_interface_.get(), web_contents(), | 488 return BrowserPageTrackDecider(embedder_interface_.get(), web_contents(), |
| 489 navigation_handle).ShouldTrack(); | 489 navigation_handle).ShouldTrack(); |
| 490 } | 490 } |
| 491 | 491 |
| 492 } // namespace page_load_metrics | 492 } // namespace page_load_metrics |
| OLD | NEW |