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

Unified Diff: content/shell/shell_login_dialog.h

Issue 9980002: Mac content shell: HTTP auth. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/shell/shell_content_browser_client.cc ('k') | content/shell/shell_login_dialog.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/shell_login_dialog.h
diff --git a/content/shell/shell_login_dialog.h b/content/shell/shell_login_dialog.h
new file mode 100644
index 0000000000000000000000000000000000000000..b944c195fefdfb24a79b36319266b85c17dcb7e6
--- /dev/null
+++ b/content/shell/shell_login_dialog.h
@@ -0,0 +1,87 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_SHELL_SHELL_LOGIN_DIALOG_H_
+#define CONTENT_SHELL_SHELL_LOGIN_DIALOG_H_
+#pragma once
+
+#include "base/compiler_specific.h"
+#include "base/string16.h"
+#include "content/public/browser/resource_dispatcher_host_login_delegate.h"
+
+#if defined(OS_MACOSX)
+#if __OBJC__
+@class ShellLoginDialogHelper;
+#else
+class ShellLoginDialogHelper;
+#endif // __OBJC__
+#endif // defined(OS_MACOSX)
+
+namespace net {
+class AuthChallengeInfo;
+class URLRequest;
+}
+
+namespace content {
+
+// This class provides a dialog box to ask the user for credentials. Useful in
+// ResourceDispatcherHostDelegate::CreateLoginDelegate.
+class ShellLoginDialog : public ResourceDispatcherHostLoginDelegate {
+ public:
+ // Threading: IO thread.
+ ShellLoginDialog(net::AuthChallengeInfo* auth_info, net::URLRequest* request);
+ // Threading: any
+ virtual ~ShellLoginDialog();
+
+ // ResourceDispatcherHostLoginDelegate implementation:
+ // Threading: IO thread.
+ virtual void OnRequestCancelled() OVERRIDE;
+
+ // Called by the platform specific code when the user responds. Public because
+ // the aforementioned platform specific code may not have access to private
+ // members. Not to be called from client code.
+ // Threading: UI thread.
+ void UserAcceptedAuth(const string16& username, const string16& password);
+ void UserCancelledAuth();
+
+ private:
+ // All the methods that begin with Platform need to be implemented by the
+ // platform specific LoginDialog implementation.
+ // Creates the dialog.
+ // Threading: UI thread.
+ void PlatformCreateDialog(const string16& message);
+ // Called from the destructor to let each platform do any necessary cleanup.
+ // Threading: UI thread.
+ void PlatformCleanUp();
+ // Called from OnRequestCancelled if the request was cancelled.
+ // Threading: UI thread.
+ void PlatformRequestCancelled();
+
+ // Sets up dialog creation.
+ // Threading: UI thread.
+ void PrepDialog(const string16& host, const string16& realm);
+
+ // Sends the authentication to the requester.
+ // Threading: IO thread.
+ void SendAuthToRequester(bool success,
+ const string16& username,
+ const string16& password);
+
+ // Who/where/what asked for the authentication.
+ // Threading: IO thread.
+ scoped_refptr<net::AuthChallengeInfo> auth_info_;
+
+ // The request that wants login data.
+ // Threading: IO thread.
+ net::URLRequest* request_;
+
+#if defined(OS_MACOSX)
+ // Threading: UI thread.
+ ShellLoginDialogHelper* helper_; // owned
+#endif
+};
+
+} // namespace content
+
+#endif // CONTENT_SHELL_SHELL_LOGIN_DIALOG_H_
« no previous file with comments | « content/shell/shell_content_browser_client.cc ('k') | content/shell/shell_login_dialog.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698