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

Side by Side Diff: chrome/browser/supervised_user/supervised_user_navigation_observer.cc

Issue 2345053006: Remove IsSynchronous API from NavigationHandle. (Closed)
Patch Set: Addressed review comments. Created 4 years, 1 month 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/supervised_user/supervised_user_navigation_observer.h" 5 #include "chrome/browser/supervised_user/supervised_user_navigation_observer.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "chrome/browser/history/history_service_factory.h" 9 #include "chrome/browser/history/history_service_factory.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 navigation_observer->OnRequestBlockedInternal(url); 59 navigation_observer->OnRequestBlockedInternal(url);
60 60
61 // Show the interstitial. 61 // Show the interstitial.
62 const bool initial_page_load = true; 62 const bool initial_page_load = true;
63 SupervisedUserInterstitial::Show(web_contents, url, reason, initial_page_load, 63 SupervisedUserInterstitial::Show(web_contents, url, reason, initial_page_load,
64 callback); 64 callback);
65 } 65 }
66 66
67 void SupervisedUserNavigationObserver::DidFinishNavigation( 67 void SupervisedUserNavigationObserver::DidFinishNavigation(
68 content::NavigationHandle* navigation_handle) { 68 content::NavigationHandle* navigation_handle) {
69 // Only filter synchronous navigations (eg. pushState/popState); others will 69 // Only filter same page navigations (eg. pushState/popState); others will
70 // have been filtered by the ResourceThrottle. 70 // have been filtered by the ResourceThrottle.
71 if (!navigation_handle->IsSynchronousNavigation()) 71 if (!navigation_handle->IsSamePage())
72 return; 72 return;
73 73
74 if (!navigation_handle->IsInMainFrame()) 74 if (!navigation_handle->IsInMainFrame())
75 return; 75 return;
76 76
77 url_filter_->GetFilteringBehaviorForURLWithAsyncChecks( 77 url_filter_->GetFilteringBehaviorForURLWithAsyncChecks(
78 web_contents()->GetLastCommittedURL(), 78 web_contents()->GetLastCommittedURL(),
79 base::Bind(&SupervisedUserNavigationObserver::URLFilterCheckCallback, 79 base::Bind(&SupervisedUserNavigationObserver::URLFilterCheckCallback,
80 weak_ptr_factory_.GetWeakPtr(), 80 weak_ptr_factory_.GetWeakPtr(),
81 navigation_handle->GetURL())); 81 navigation_handle->GetURL()));
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 if (url != web_contents()->GetLastCommittedURL()) 128 if (url != web_contents()->GetLastCommittedURL())
129 return; 129 return;
130 130
131 const bool initial_page_load = false; 131 const bool initial_page_load = false;
132 if (behavior == SupervisedUserURLFilter::FilteringBehavior::BLOCK) { 132 if (behavior == SupervisedUserURLFilter::FilteringBehavior::BLOCK) {
133 SupervisedUserInterstitial::Show(web_contents(), url, reason, 133 SupervisedUserInterstitial::Show(web_contents(), url, reason,
134 initial_page_load, 134 initial_page_load,
135 base::Callback<void(bool)>()); 135 base::Callback<void(bool)>());
136 } 136 }
137 } 137 }
OLDNEW
« no previous file with comments | « chrome/browser/ssl/chrome_security_state_model_client.cc ('k') | content/browser/frame_host/navigation_handle_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698