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

Side by Side Diff: content/browser/frame_host/navigation_handle_impl.cc

Issue 2272123002: [HBD] Intercept navigation to Flash download page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Unit test Created 4 years, 3 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 "content/browser/frame_host/navigation_handle_impl.h" 5 #include "content/browser/frame_host/navigation_handle_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "content/browser/browsing_data/clear_site_data_throttle.h" 10 #include "content/browser/browsing_data/clear_site_data_throttle.h"
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 NavigationThrottle::ThrottleCheckResult result = NavigationThrottle::DEFER; 309 NavigationThrottle::ThrottleCheckResult result = NavigationThrottle::DEFER;
310 WillProcessResponse(static_cast<RenderFrameHostImpl*>(render_frame_host), 310 WillProcessResponse(static_cast<RenderFrameHostImpl*>(render_frame_host),
311 scoped_refptr<net::HttpResponseHeaders>(), 311 scoped_refptr<net::HttpResponseHeaders>(),
312 base::Bind(&UpdateThrottleCheckResult, &result)); 312 base::Bind(&UpdateThrottleCheckResult, &result));
313 313
314 // Reset the callback to ensure it will not be called later. 314 // Reset the callback to ensure it will not be called later.
315 complete_callback_.Reset(); 315 complete_callback_.Reset();
316 return result; 316 return result;
317 } 317 }
318 318
319 void NavigationHandleImpl::SetHasUserGestureForTesting(bool has_user_gesture) {
320 has_user_gesture_ = has_user_gesture;
321 }
322
319 NavigationData* NavigationHandleImpl::GetNavigationData() { 323 NavigationData* NavigationHandleImpl::GetNavigationData() {
320 return navigation_data_.get(); 324 return navigation_data_.get();
321 } 325 }
322 326
323 void NavigationHandleImpl::WillStartRequest( 327 void NavigationHandleImpl::WillStartRequest(
324 const std::string& method, 328 const std::string& method,
325 scoped_refptr<content::ResourceRequestBodyImpl> resource_request_body, 329 scoped_refptr<content::ResourceRequestBodyImpl> resource_request_body,
326 const Referrer& sanitized_referrer, 330 const Referrer& sanitized_referrer,
327 bool has_user_gesture, 331 bool has_user_gesture,
328 ui::PageTransition transition, 332 ui::PageTransition transition,
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 throttles_to_register.push_back(std::move(clear_site_data_throttle)); 569 throttles_to_register.push_back(std::move(clear_site_data_throttle));
566 570
567 if (throttles_to_register.size() > 0) { 571 if (throttles_to_register.size() > 0) {
568 throttles_.insert(throttles_.begin(), throttles_to_register.begin(), 572 throttles_.insert(throttles_.begin(), throttles_to_register.begin(),
569 throttles_to_register.end()); 573 throttles_to_register.end());
570 throttles_to_register.weak_clear(); 574 throttles_to_register.weak_clear();
571 } 575 }
572 } 576 }
573 577
574 } // namespace content 578 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698