OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_CHROMEOS_ARC_ARC_AUTH_UI_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_UI_H_ |
6 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_UI_H_ | 6 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_UI_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "components/arc/auth/arc_auth_fetcher.h" | 9 #include "components/arc/auth/arc_auth_fetcher.h" |
10 #include "ui/web_dialogs/web_dialog_delegate.h" | 10 #include "ui/web_dialogs/web_dialog_delegate.h" |
11 | 11 |
12 namespace content { | 12 namespace content { |
13 class BrowserContext; | 13 class BrowserContext; |
14 } | 14 } |
15 | 15 |
16 namespace views { | 16 namespace views { |
17 class Widget; | 17 class Widget; |
18 } | 18 } |
19 | 19 |
20 namespace arc { | 20 namespace arc { |
21 | 21 |
22 // Shows ARC LSO web view that requires user input. | 22 // Shows ARC LSO web view that requires user input. |
23 class ArcAuthUI : public ui::WebDialogDelegate, | 23 class ArcAuthUI : public ui::WebDialogDelegate, |
24 public ArcAuthFetcher::Delegate { | 24 public ArcAuthFetcher::Delegate { |
25 public: | 25 public: |
26 class Delegate { | 26 class Delegate { |
27 public: | 27 public: |
| 28 // Called when AuthCode was fetched. |
| 29 virtual void OnAuthCodeFetchedFromUI(const std::string& auth_code) = 0; |
28 // Called when dialog is closed. | 30 // Called when dialog is closed. |
29 virtual void OnAuthUIClosed() = 0; | 31 virtual void OnAuthUIClosed() = 0; |
30 | 32 |
31 protected: | 33 protected: |
32 virtual ~Delegate() = default; | 34 virtual ~Delegate() = default; |
33 }; | 35 }; |
34 | 36 |
35 ArcAuthUI(content::BrowserContext* browser_context, Delegate* delegate); | 37 ArcAuthUI(content::BrowserContext* browser_context, Delegate* delegate); |
36 ~ArcAuthUI() override; | 38 ~ArcAuthUI() override; |
37 | 39 |
(...skipping 29 matching lines...) Expand all Loading... |
67 views::Widget* widget_; | 69 views::Widget* widget_; |
68 | 70 |
69 scoped_ptr<ArcAuthFetcher> auth_fetcher_; | 71 scoped_ptr<ArcAuthFetcher> auth_fetcher_; |
70 | 72 |
71 DISALLOW_COPY_AND_ASSIGN(ArcAuthUI); | 73 DISALLOW_COPY_AND_ASSIGN(ArcAuthUI); |
72 }; | 74 }; |
73 | 75 |
74 } // namespace arc | 76 } // namespace arc |
75 | 77 |
76 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_UI_H_ | 78 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_UI_H_ |
OLD | NEW |