| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 public: | 44 public: |
| 45 // Called when the auth flow is completed successfully. | 45 // Called when the auth flow is completed successfully. |
| 46 // |redirect_url| is the full URL the provider redirected to at the end | 46 // |redirect_url| is the full URL the provider redirected to at the end |
| 47 // of the flow. | 47 // of the flow. |
| 48 virtual void OnAuthFlowSuccess(const std::string& redirect_url) = 0; | 48 virtual void OnAuthFlowSuccess(const std::string& redirect_url) = 0; |
| 49 // Called when the auth flow fails. This means that the flow did not result | 49 // Called when the auth flow fails. This means that the flow did not result |
| 50 // in a successful redirect to a valid redirect URL or the user canceled | 50 // in a successful redirect to a valid redirect URL or the user canceled |
| 51 // the flow. | 51 // the flow. |
| 52 virtual void OnAuthFlowFailure() = 0; | 52 virtual void OnAuthFlowFailure() = 0; |
| 53 | 53 |
| 54 virtual ~Delegate() { } | 54 protected: |
| 55 virtual ~Delegate() {} |
| 55 }; | 56 }; |
| 56 | 57 |
| 57 // Interceptor interface for testing. | 58 // Interceptor interface for testing. |
| 58 class InterceptorForTests { | 59 class InterceptorForTests { |
| 59 public: | 60 public: |
| 60 virtual GURL DoIntercept(const GURL& provider_url) = 0; | 61 virtual GURL DoIntercept(const GURL& provider_url) = 0; |
| 61 virtual ~InterceptorForTests() { } | 62 virtual ~InterceptorForTests() { } |
| 62 }; | 63 }; |
| 63 static void SetInterceptorForTests(InterceptorForTests* interceptor); | 64 static void SetInterceptorForTests(InterceptorForTests* interceptor); |
| 64 | 65 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 | 110 |
| 110 content::WebContents* contents_; | 111 content::WebContents* contents_; |
| 111 WebAuthFlowWindow* window_; | 112 WebAuthFlowWindow* window_; |
| 112 | 113 |
| 113 DISALLOW_COPY_AND_ASSIGN(WebAuthFlow); | 114 DISALLOW_COPY_AND_ASSIGN(WebAuthFlow); |
| 114 }; | 115 }; |
| 115 | 116 |
| 116 } // namespace extensions | 117 } // namespace extensions |
| 117 | 118 |
| 118 #endif // CHROME_BROWSER_EXTENSIONS_API_IDENTITY_WEB_AUTH_FLOW_H_ | 119 #endif // CHROME_BROWSER_EXTENSIONS_API_IDENTITY_WEB_AUTH_FLOW_H_ |
| OLD | NEW |