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

Side by Side Diff: chrome/browser/signin/signin_header_helper.h

Issue 345533005: Parse extra parameters on x-chrome-manage-accounts header (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 CHROME_BROWSER_SIGNIN_SIGNIN_HEADER_HELPER_H_ 5 #ifndef CHROME_BROWSER_SIGNIN_SIGNIN_HEADER_HELPER_H_
6 #define CHROME_BROWSER_SIGNIN_SIGNIN_HEADER_HELPER_H_ 6 #define CHROME_BROWSER_SIGNIN_SIGNIN_HEADER_HELPER_H_
7 7
8 namespace net { 8 namespace net {
9 class URLRequest; 9 class URLRequest;
10 } 10 }
(...skipping 23 matching lines...) Expand all
34 GAIA_SERVICE_TYPE_NONE = 0, // No GAIA response header. 34 GAIA_SERVICE_TYPE_NONE = 0, // No GAIA response header.
35 GAIA_SERVICE_TYPE_SIGNOUT, // Logout all existing sessions. 35 GAIA_SERVICE_TYPE_SIGNOUT, // Logout all existing sessions.
36 GAIA_SERVICE_TYPE_INCOGNITO, // Open an incognito tab. 36 GAIA_SERVICE_TYPE_INCOGNITO, // Open an incognito tab.
37 GAIA_SERVICE_TYPE_ADDSESSION, // Add a secondary account. 37 GAIA_SERVICE_TYPE_ADDSESSION, // Add a secondary account.
38 GAIA_SERVICE_TYPE_REAUTH, // Re-authenticate an account. 38 GAIA_SERVICE_TYPE_REAUTH, // Re-authenticate an account.
39 GAIA_SERVICE_TYPE_DEFAULT, // All other cases. 39 GAIA_SERVICE_TYPE_DEFAULT, // All other cases.
40 }; 40 };
41 41
42 // Struct describing the paramters received in the manage account header. 42 // Struct describing the paramters received in the manage account header.
43 struct ManageAccountsParams { 43 struct ManageAccountsParams {
44 // The requested service type such as "ADDSESSION".
44 GAIAServiceType service_type; 45 GAIAServiceType service_type;
46 // The prefilled email.
47 std::string email;
48 // Whether |email| is a saml account.
49 bool is_saml;
50 // The continue URL after the requested service is completed successfully.
51 // Defaults to the current URL if empty.
52 std::string continue_url;
53 // Whether the continue URL should be loaded in the same tab.
54 bool is_same_tab;
55 // The child id associated with the web content of the request.
56 int child_id;
57 // The route id associated with the web content of the request.
58 int route_id;
59
60 ManageAccountsParams() : service_type(GAIA_SERVICE_TYPE_NONE),
61 email(""),
62 is_saml(false),
63 continue_url(""),
64 is_same_tab(false),
65 child_id(0),
66 route_id(0) {}
45 }; 67 };
46 68
47 // Adds X-Chrome-Connected header to all Gaia requests from a connected profile, 69 // Adds X-Chrome-Connected header to all Gaia requests from a connected profile,
48 // with the exception of requests from gaia webview. Must be called on IO 70 // with the exception of requests from gaia webview. Must be called on IO
49 // thread. 71 // thread.
50 // Returns true if the account management header was added to the request. 72 // Returns true if the account management header was added to the request.
51 bool AppendMirrorRequestHeaderIfPossible( 73 bool AppendMirrorRequestHeaderIfPossible(
52 net::URLRequest* request, 74 net::URLRequest* request,
53 const GURL& redirect_url, 75 const GURL& redirect_url,
54 ProfileIOData* io_data, 76 ProfileIOData* io_data,
55 int child_id, 77 int child_id,
56 int route_id); 78 int route_id);
57 79
58 // Returns the parameters contained in the X-Chrome-Manage-Accounts response 80 // Returns the parameters contained in the X-Chrome-Manage-Accounts response
59 // header. 81 // header.
60 // If the request does not have a response header or if the header contains 82 // If the request does not have a response header or if the header contains
61 // garbage, then |service_type| is set to |GAIA_SERVICE_TYPE_NONE|. 83 // garbage, then |service_type| is set to |GAIA_SERVICE_TYPE_NONE|.
62 // Must be called on IO thread. 84 // Must be called on IO thread.
63 ManageAccountsParams GetManageAccountsParams(net::URLRequest* request, 85 ManageAccountsParams GetManageAccountsParams(net::URLRequest* request,
64 ProfileIOData* io_data); 86 ProfileIOData* io_data);
Roger Tawa OOO till Jul 10th 2014/06/19 14:47:21 Does this method need to be public? Seems like it
guohui 2014/06/19 17:44:19 Done.
65 87
66 // Looks for the X-Chrome-Manage-Accounts response header, and if found, 88 // Looks for the X-Chrome-Manage-Accounts response header, and if found,
67 // tries to show the avatar bubble in the browser identified by the 89 // tries to show the avatar bubble in the browser identified by the
68 // child/route id. Must be called on IO thread. 90 // child/route id. Must be called on IO thread.
69 void ProcessMirrorResponseHeaderIfExists( 91 void ProcessMirrorResponseHeaderIfExists(
70 net::URLRequest* request, 92 net::URLRequest* request,
71 ProfileIOData* io_data, 93 ProfileIOData* io_data,
72 int child_id, 94 int child_id,
73 int route_id); 95 int route_id);
74 96
75 }; // namespace signin 97 }; // namespace signin
76 98
77 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_HEADER_HELPER_H_ 99 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_HEADER_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698