Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / chromeos / login / profile_auth_data.h
index f4f25b9..59a35a2 100644 (file)
@@ -5,8 +5,8 @@
 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_PROFILE_AUTH_DATA_H_
 #define CHROME_BROWSER_CHROMEOS_LOGIN_PROFILE_AUTH_DATA_H_
 
-#include <string>
-#include "base/callback.h"
+#include "base/callback_forward.h"
+#include "base/macros.h"
 
 namespace content {
 class BrowserContext;
@@ -14,18 +14,28 @@ class BrowserContext;
 
 namespace chromeos {
 
-// Helper class for transferring authentication related data from one
-// BrowserContext to another: proxy auth cache, cookies, server bound certs.
+// Helper class that transfers authentication-related data from a BrowserContext
+// used for authentication to the user's actual BrowserContext.
 class ProfileAuthData {
  public:
-  // Transfers proxy authentication cache and optionally |transfer_cookies| and
-  // server bound certs from the BrowserContext that was used for
-  // authentication. |completion_callback| will be called on UI thread after
-  // the operation is completed.
-  static void Transfer(content::BrowserContext* from_context,
-                       content::BrowserContext* to_context,
-                       bool transfer_cookies,
-                       const base::Closure& completion_callback);
+  // Transfers authentication-related data from |from_context| to |to_context|
+  // and invokes |completion_callback| on the UI thread when the operation has
+  // completed. The following data is transferred:
+  // * The proxy authentication state.
+  // * All authentication cookies and channel IDs, if
+  //   |transfer_auth_cookies_and_channel_ids_on_first_login| is true and
+  //   |to_context|'s cookie jar is empty. If the cookie jar is not empty, the
+  //   authentication states in |from_context| and |to_context| should be merged
+  //   using /MergeSession instead.
+  // * The authentication cookies set by a SAML IdP, if
+  //   |transfer_saml_auth_cookies_on_subsequent_login| is true and
+  //   |to_context|'s cookie jar is not empty.
+  static void Transfer(
+      content::BrowserContext* from_context,
+      content::BrowserContext* to_context,
+      bool transfer_auth_cookies_and_channel_ids_on_first_login,
+      bool transfer_saml_auth_cookies_on_subsequent_login,
+      const base::Closure& completion_callback);
 
  private:
   DISALLOW_IMPLICIT_CONSTRUCTORS(ProfileAuthData);