Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(288)

Side by Side Diff: chrome/browser/page_load_metrics/metrics_web_contents_observer.cc

Issue 2573073003: Collapse the API surface on WebInputEvent via accessor functions. (Closed)
Patch Set: Fix nits Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698