| 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_SHELL_SHELL_LOGIN_DIALOG_H_ | 5 #ifndef CONTENT_SHELL_SHELL_LOGIN_DIALOG_H_ |
| 6 #define CONTENT_SHELL_SHELL_LOGIN_DIALOG_H_ | 6 #define CONTENT_SHELL_SHELL_LOGIN_DIALOG_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/string16.h" | 10 #include "base/string16.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 } | 24 } |
| 25 | 25 |
| 26 namespace content { | 26 namespace content { |
| 27 | 27 |
| 28 // This class provides a dialog box to ask the user for credentials. Useful in | 28 // This class provides a dialog box to ask the user for credentials. Useful in |
| 29 // ResourceDispatcherHostDelegate::CreateLoginDelegate. | 29 // ResourceDispatcherHostDelegate::CreateLoginDelegate. |
| 30 class ShellLoginDialog : public ResourceDispatcherHostLoginDelegate { | 30 class ShellLoginDialog : public ResourceDispatcherHostLoginDelegate { |
| 31 public: | 31 public: |
| 32 // Threading: IO thread. | 32 // Threading: IO thread. |
| 33 ShellLoginDialog(net::AuthChallengeInfo* auth_info, net::URLRequest* request); | 33 ShellLoginDialog(net::AuthChallengeInfo* auth_info, net::URLRequest* request); |
| 34 // Threading: any | |
| 35 virtual ~ShellLoginDialog(); | |
| 36 | 34 |
| 37 // ResourceDispatcherHostLoginDelegate implementation: | 35 // ResourceDispatcherHostLoginDelegate implementation: |
| 38 // Threading: IO thread. | 36 // Threading: IO thread. |
| 39 virtual void OnRequestCancelled() OVERRIDE; | 37 virtual void OnRequestCancelled() OVERRIDE; |
| 40 | 38 |
| 41 // Called by the platform specific code when the user responds. Public because | 39 // Called by the platform specific code when the user responds. Public because |
| 42 // the aforementioned platform specific code may not have access to private | 40 // the aforementioned platform specific code may not have access to private |
| 43 // members. Not to be called from client code. | 41 // members. Not to be called from client code. |
| 44 // Threading: UI thread. | 42 // Threading: UI thread. |
| 45 void UserAcceptedAuth(const string16& username, const string16& password); | 43 void UserAcceptedAuth(const string16& username, const string16& password); |
| 46 void UserCancelledAuth(); | 44 void UserCancelledAuth(); |
| 47 | 45 |
| 46 protected: |
| 47 // Threading: any |
| 48 virtual ~ShellLoginDialog(); |
| 49 |
| 48 private: | 50 private: |
| 49 // All the methods that begin with Platform need to be implemented by the | 51 // All the methods that begin with Platform need to be implemented by the |
| 50 // platform specific LoginDialog implementation. | 52 // platform specific LoginDialog implementation. |
| 51 // Creates the dialog. | 53 // Creates the dialog. |
| 52 // Threading: UI thread. | 54 // Threading: UI thread. |
| 53 void PlatformCreateDialog(const string16& message); | 55 void PlatformCreateDialog(const string16& message); |
| 54 // Called from the destructor to let each platform do any necessary cleanup. | 56 // Called from the destructor to let each platform do any necessary cleanup. |
| 55 // Threading: UI thread. | 57 // Threading: UI thread. |
| 56 void PlatformCleanUp(); | 58 void PlatformCleanUp(); |
| 57 // Called from OnRequestCancelled if the request was cancelled. | 59 // Called from OnRequestCancelled if the request was cancelled. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 78 | 80 |
| 79 #if defined(OS_MACOSX) | 81 #if defined(OS_MACOSX) |
| 80 // Threading: UI thread. | 82 // Threading: UI thread. |
| 81 ShellLoginDialogHelper* helper_; // owned | 83 ShellLoginDialogHelper* helper_; // owned |
| 82 #endif | 84 #endif |
| 83 }; | 85 }; |
| 84 | 86 |
| 85 } // namespace content | 87 } // namespace content |
| 86 | 88 |
| 87 #endif // CONTENT_SHELL_SHELL_LOGIN_DIALOG_H_ | 89 #endif // CONTENT_SHELL_SHELL_LOGIN_DIALOG_H_ |
| OLD | NEW |