OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_LOGIN_DELEGATE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_LOGIN_DELEGATE_H_ |
6 #define CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_LOGIN_DELEGATE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_LOGIN_DELEGATE_H_ |
7 #pragma once | |
8 | 7 |
9 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
10 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
11 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
12 | 11 |
13 namespace content { | 12 namespace content { |
14 | 13 |
15 // Interface for getting login credentials for HTTP auth requests. If the | 14 // Interface for getting login credentials for HTTP auth requests. If the |
16 // login delegate obtains credentials, it should call the URLRequest's SetAuth | 15 // login delegate obtains credentials, it should call the URLRequest's SetAuth |
17 // method. If the user cancels, the login delegate should call the URLRequest's | 16 // method. If the user cancels, the login delegate should call the URLRequest's |
18 // CancelAuth instead. And in either case, it must make a call to | 17 // CancelAuth instead. And in either case, it must make a call to |
19 // ResourceDispatcherHost::ClearLoginDelegateForRequest. | 18 // ResourceDispatcherHost::ClearLoginDelegateForRequest. |
20 class CONTENT_EXPORT ResourceDispatcherHostLoginDelegate | 19 class CONTENT_EXPORT ResourceDispatcherHostLoginDelegate |
21 : public base::RefCountedThreadSafe<ResourceDispatcherHostLoginDelegate> { | 20 : public base::RefCountedThreadSafe<ResourceDispatcherHostLoginDelegate> { |
22 public: | 21 public: |
23 // Notify the login delegate that the request was cancelled. | 22 // Notify the login delegate that the request was cancelled. |
24 // This function can only be called from the IO thread. | 23 // This function can only be called from the IO thread. |
25 virtual void OnRequestCancelled() = 0; | 24 virtual void OnRequestCancelled() = 0; |
26 | 25 |
27 protected: | 26 protected: |
28 friend class base::RefCountedThreadSafe<ResourceDispatcherHostLoginDelegate>; | 27 friend class base::RefCountedThreadSafe<ResourceDispatcherHostLoginDelegate>; |
29 virtual ~ResourceDispatcherHostLoginDelegate() {} | 28 virtual ~ResourceDispatcherHostLoginDelegate() {} |
30 }; | 29 }; |
31 | 30 |
32 } // public content | 31 } // public content |
33 | 32 |
34 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_LOGIN_DELEGATE_H_ | 33 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_LOGIN_DELEGATE_H_ |
OLD | NEW |