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

Side by Side Diff: chrome/browser/chromeos/login/signin/merge_session_navigation_throttle.cc

Issue 1910693002: Avoid the long merge session throttle interstitial page for NTP on Chrome OS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: piman's nit Created 4 years, 8 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/chromeos/login/signin/merge_session_resource_throttle.cc » ('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/chromeos/login/signin/merge_session_navigation_throttle .h" 5 #include "chrome/browser/chromeos/login/signin/merge_session_navigation_throttle .h"
6 6
7 #include "chrome/browser/chromeos/login/signin/merge_session_load_page.h" 7 #include "chrome/browser/chromeos/login/signin/merge_session_load_page.h"
8 #include "content/public/browser/browser_thread.h" 8 #include "content/public/browser/browser_thread.h"
9 #include "content/public/browser/navigation_handle.h" 9 #include "content/public/browser/navigation_handle.h"
10 10
(...skipping 12 matching lines...) Expand all
23 23
24 MergeSessionNavigationThrottle::~MergeSessionNavigationThrottle() { 24 MergeSessionNavigationThrottle::~MergeSessionNavigationThrottle() {
25 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 25 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
26 } 26 }
27 27
28 content::NavigationThrottle::ThrottleCheckResult 28 content::NavigationThrottle::ThrottleCheckResult
29 MergeSessionNavigationThrottle::WillStartRequest() { 29 MergeSessionNavigationThrottle::WillStartRequest() {
30 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 30 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
31 if (!merge_session_throttling_utils::ShouldDelayUrl( 31 if (!merge_session_throttling_utils::ShouldDelayUrl(
32 navigation_handle()->GetURL()) || 32 navigation_handle()->GetURL()) ||
33 !merge_session_throttling_utils::ShouldDelayRequest( 33 !merge_session_throttling_utils::ShouldDelayRequestForWebContents(
34 navigation_handle()->GetWebContents())) { 34 navigation_handle()->GetWebContents())) {
35 return content::NavigationThrottle::PROCEED; 35 return content::NavigationThrottle::PROCEED;
36 } 36 }
37 37
38 // The MergeSessionLoadPage will be deleted by the interstitial page once it 38 // The MergeSessionLoadPage will be deleted by the interstitial page once it
39 // is closed. 39 // is closed.
40 (new chromeos::MergeSessionLoadPage( 40 (new chromeos::MergeSessionLoadPage(
41 navigation_handle()->GetWebContents(), navigation_handle()->GetURL(), 41 navigation_handle()->GetWebContents(), navigation_handle()->GetURL(),
42 base::Bind(&MergeSessionNavigationThrottle::OnBlockingPageComplete, 42 base::Bind(&MergeSessionNavigationThrottle::OnBlockingPageComplete,
43 weak_factory_.GetWeakPtr()))) 43 weak_factory_.GetWeakPtr())))
44 ->Show(); 44 ->Show();
45 return content::NavigationThrottle::DEFER; 45 return content::NavigationThrottle::DEFER;
46 } 46 }
47 47
48 void MergeSessionNavigationThrottle::OnBlockingPageComplete() { 48 void MergeSessionNavigationThrottle::OnBlockingPageComplete() {
49 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 49 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
50 navigation_handle()->Resume(); 50 navigation_handle()->Resume();
51 } 51 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/signin/merge_session_resource_throttle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698