| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "content/browser/content_resource_dispatcher_host.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
| 9 |
| 10 namespace content { |
| 11 |
| 12 namespace { |
| 13 |
| 14 static ContentResourceDispatcherHost* g_content_resource_dispatcher_host; |
| 15 |
| 16 } // namespace |
| 17 |
| 18 // static |
| 19 ResourceDispatcherHost* ResourceDispatcherHost::Get() { |
| 20 return g_content_resource_dispatcher_host; |
| 21 } |
| 22 |
| 23 ContentResourceDispatcherHost::ContentResourceDispatcherHost() |
| 24 : child_(nullptr), |
| 25 content_resource_dispatcher_host_delegate_( |
| 26 new ContentResourceDispatcherHostDelegate()) { |
| 27 DCHECK(!g_content_resource_dispatcher_host); |
| 28 g_content_resource_dispatcher_host = this; |
| 29 } |
| 30 |
| 31 ContentResourceDispatcherHost::~ContentResourceDispatcherHost() { |
| 32 DCHECK(g_content_resource_dispatcher_host); |
| 33 g_content_resource_dispatcher_host = nullptr; |
| 34 } |
| 35 |
| 36 void ContentResourceDispatcherHost::SetChild( |
| 37 ResourceDispatcherHostImpl* child) { |
| 38 child_ = child; |
| 39 } |
| 40 |
| 41 void ContentResourceDispatcherHost::SetDelegate( |
| 42 ResourceDispatcherHostDelegate* delegate) { |
| 43 content_resource_dispatcher_host_delegate_->SetChild(delegate); |
| 44 child_->SetDelegate(content_resource_dispatcher_host_delegate_.get()); |
| 45 } |
| 46 |
| 47 void ContentResourceDispatcherHost::SetAllowCrossOriginAuthPrompt(bool value) { |
| 48 child_->SetAllowCrossOriginAuthPrompt(value); |
| 49 } |
| 50 |
| 51 void ContentResourceDispatcherHost::ClearLoginDelegateForRequest( |
| 52 net::URLRequest* request) { |
| 53 child_->ClearLoginDelegateForRequest(request); |
| 54 } |
| 55 |
| 56 } // namespace content |
| OLD | NEW |