| 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 CHROME_BROWSER_EXTENSIONS_API_IDENTITY_WEB_AUTH_FLOW_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_IDENTITY_WEB_AUTH_FLOW_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_IDENTITY_WEB_AUTH_FLOW_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_IDENTITY_WEB_AUTH_FLOW_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/ui/host_desktop.h" | 8 #include "chrome/browser/ui/host_desktop.h" |
| 9 #include "content/public/browser/notification_observer.h" | 9 #include "content/public/browser/notification_observer.h" |
| 10 #include "content/public/browser/notification_registrar.h" | 10 #include "content/public/browser/notification_registrar.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 class Delegate { | 53 class Delegate { |
| 54 public: | 54 public: |
| 55 // Called when the auth flow fails. This means that the flow did not result | 55 // Called when the auth flow fails. This means that the flow did not result |
| 56 // in a successful redirect to a valid redirect URL. | 56 // in a successful redirect to a valid redirect URL. |
| 57 virtual void OnAuthFlowFailure(Failure failure) = 0; | 57 virtual void OnAuthFlowFailure(Failure failure) = 0; |
| 58 // Called on redirects and other navigations to see if the URL should stop | 58 // Called on redirects and other navigations to see if the URL should stop |
| 59 // the flow. | 59 // the flow. |
| 60 virtual void OnAuthFlowURLChange(const GURL& redirect_url) = 0; | 60 virtual void OnAuthFlowURLChange(const GURL& redirect_url) = 0; |
| 61 // Called when the title of the current page changes. |
| 62 virtual void OnAuthFlowTitleChange(const std::string& title) = 0; |
| 61 | 63 |
| 62 protected: | 64 protected: |
| 63 virtual ~Delegate() {} | 65 virtual ~Delegate() {} |
| 64 }; | 66 }; |
| 65 | 67 |
| 66 // Creates an instance with the given parameters. | 68 // Creates an instance with the given parameters. |
| 67 // Caller owns |delegate|. | 69 // Caller owns |delegate|. |
| 68 WebAuthFlow(Delegate* delegate, | 70 WebAuthFlow(Delegate* delegate, |
| 69 Profile* profile, | 71 Profile* profile, |
| 70 const GURL& provider_url, | 72 const GURL& provider_url, |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 113 |
| 112 content::WebContents* contents_; | 114 content::WebContents* contents_; |
| 113 content::NotificationRegistrar registrar_; | 115 content::NotificationRegistrar registrar_; |
| 114 | 116 |
| 115 DISALLOW_COPY_AND_ASSIGN(WebAuthFlow); | 117 DISALLOW_COPY_AND_ASSIGN(WebAuthFlow); |
| 116 }; | 118 }; |
| 117 | 119 |
| 118 } // namespace extensions | 120 } // namespace extensions |
| 119 | 121 |
| 120 #endif // CHROME_BROWSER_EXTENSIONS_API_IDENTITY_WEB_AUTH_FLOW_H_ | 122 #endif // CHROME_BROWSER_EXTENSIONS_API_IDENTITY_WEB_AUTH_FLOW_H_ |
| OLD | NEW |