| OLD | NEW |
| 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_UI_WEBUI_SIGNIN_INLINE_LOGIN_UI_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_SIGNIN_INLINE_LOGIN_UI_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_SIGNIN_INLINE_LOGIN_UI_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_SIGNIN_INLINE_LOGIN_UI_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "chrome/browser/extensions/signin/scoped_gaia_auth_extension.h" | 9 #include "chrome/browser/extensions/signin/scoped_gaia_auth_extension.h" |
| 10 #include "ui/web_dialogs/web_dialog_ui.h" | 10 #include "ui/web_dialogs/web_dialog_ui.h" |
| 11 | 11 |
| 12 namespace content { | |
| 13 class RenderFrameHost; | |
| 14 } | |
| 15 | |
| 16 // Inline login WebUI in various signin flows for ChromeOS and Chrome desktop. | 12 // Inline login WebUI in various signin flows for ChromeOS and Chrome desktop. |
| 17 // The authentication is carried out via the host gaia_auth extension. Upon | 13 // The authentication is carried out via the host gaia_auth extension. Upon |
| 18 // success, the profile of the webui should be populated with proper cookies. | 14 // success, the profile of the webui should be populated with proper cookies. |
| 19 // Then this UI would fetch the oauth2 tokens using the cookies. | 15 // Then this UI would fetch the oauth2 tokens using the cookies. |
| 20 class InlineLoginUI : public ui::WebDialogUI { | 16 class InlineLoginUI : public ui::WebDialogUI { |
| 21 public: | 17 public: |
| 22 explicit InlineLoginUI(content::WebUI* web_ui); | 18 explicit InlineLoginUI(content::WebUI* web_ui); |
| 23 ~InlineLoginUI() override; | 19 ~InlineLoginUI() override; |
| 24 | 20 |
| 25 // Gets the frame (iframe or webview) within an auth page that has the | |
| 26 // specified parent origin if |parent_origin| is not empty, and the specified | |
| 27 // parent frame name. | |
| 28 static content::RenderFrameHost* GetAuthFrame( | |
| 29 content::WebContents* web_contents, | |
| 30 const GURL& parent_origin, | |
| 31 const std::string& parent_frame_name); | |
| 32 | |
| 33 static content::WebContents* GetAuthFrameWebContents( | |
| 34 content::WebContents* web_contents, | |
| 35 const GURL& parent_origin, | |
| 36 const std::string& parent_frame_name); | |
| 37 private: | 21 private: |
| 38 ScopedGaiaAuthExtension auth_extension_; | 22 ScopedGaiaAuthExtension auth_extension_; |
| 39 | 23 |
| 40 DISALLOW_COPY_AND_ASSIGN(InlineLoginUI); | 24 DISALLOW_COPY_AND_ASSIGN(InlineLoginUI); |
| 41 }; | 25 }; |
| 42 | 26 |
| 43 #endif // CHROME_BROWSER_UI_WEBUI_SIGNIN_INLINE_LOGIN_UI_H_ | 27 #endif // CHROME_BROWSER_UI_WEBUI_SIGNIN_INLINE_LOGIN_UI_H_ |
| OLD | NEW |