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

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

Issue 2593793002: Remove call to WasHidden as part of the app being backgrounded. (Closed)
Patch Set: add comment Created 3 years, 12 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
« no previous file with comments | « no previous file | chrome/browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // Note that, while a call to FlushMetricsOnAppEnterBackground usually
312 // FlushMetricsOnAppEnterBackground callback gets invoked before the 312 // indicates that the app is about to be backgrounded, there are cases where
313 // associated WasHidden callback. 313 // the app may not end up getting backgrounded. Thus, we should not assume
314 WasHidden(); 314 // anything about foreground / background state of the associated tab as part
315 // of this method call.
315 316
316 if (committed_load_) 317 if (committed_load_)
317 committed_load_->FlushMetricsOnAppEnterBackground(); 318 committed_load_->FlushMetricsOnAppEnterBackground();
318 for (const auto& kv : provisional_loads_) { 319 for (const auto& kv : provisional_loads_) {
319 kv.second->FlushMetricsOnAppEnterBackground(); 320 kv.second->FlushMetricsOnAppEnterBackground();
320 } 321 }
321 for (const auto& tracker : aborted_provisional_loads_) { 322 for (const auto& tracker : aborted_provisional_loads_) {
322 tracker->FlushMetricsOnAppEnterBackground(); 323 tracker->FlushMetricsOnAppEnterBackground();
323 } 324 }
324 } 325 }
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 content::NavigationHandle* navigation_handle) const { 474 content::NavigationHandle* navigation_handle) const {
474 DCHECK(navigation_handle->IsInMainFrame()); 475 DCHECK(navigation_handle->IsInMainFrame());
475 DCHECK(!navigation_handle->HasCommitted() || 476 DCHECK(!navigation_handle->HasCommitted() ||
476 !navigation_handle->IsSamePage()); 477 !navigation_handle->IsSamePage());
477 478
478 return BrowserPageTrackDecider(embedder_interface_.get(), web_contents(), 479 return BrowserPageTrackDecider(embedder_interface_.get(), web_contents(),
479 navigation_handle).ShouldTrack(); 480 navigation_handle).ShouldTrack();
480 } 481 }
481 482
482 } // namespace page_load_metrics 483 } // namespace page_load_metrics
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698