| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_CHROMEOS_ENTERPRISE_ENROLLMENT_UI_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_ENTERPRISE_ENROLLMENT_UI_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_ENTERPRISE_ENROLLMENT_UI_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_ENTERPRISE_ENROLLMENT_UI_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "content/browser/webui/web_ui.h" | 10 #include "content/browser/webui/web_ui.h" |
| 11 | 11 |
| 12 namespace chromeos { | 12 namespace chromeos { |
| 13 | 13 |
| 14 // WebUI implementation that handles the enterprise enrollment dialog in the | 14 // WebUI implementation that handles the enterprise enrollment dialog in the |
| 15 // Chrome OS login flow. | 15 // Chrome OS login flow. |
| 16 class EnterpriseEnrollmentUI : public WebUI { | 16 class EnterpriseEnrollmentUI : public WebUI { |
| 17 public: | 17 public: |
| 18 // This defines the interface for controllers which will be called back when | 18 // This defines the interface for controllers which will be called back when |
| 19 // something happens on the UI. It is stored in a property of the TabContents. | 19 // something happens on the UI. It is stored in a property of the TabContents. |
| 20 class Controller { | 20 class Controller { |
| 21 public: | 21 public: |
| 22 virtual ~Controller() {} | 22 virtual ~Controller() {} |
| 23 | 23 |
| 24 virtual void OnAuthSubmitted(const std::string& user, | 24 virtual void OnAuthSubmitted(const std::string& user, |
| 25 const std::string& password, | 25 const std::string& password, |
| 26 const std::string& captcha, | 26 const std::string& captcha, |
| 27 const std::string& access_code) = 0; | 27 const std::string& access_code) = 0; |
| 28 virtual void OnAuthCancelled() = 0; | 28 virtual void OnAuthCancelled() = 0; |
| 29 virtual void OnConfirmationClosed() = 0; | 29 virtual void OnConfirmationClosed() = 0; |
| 30 virtual bool GetInitialUser(std::string* user) = 0; |
| 30 }; | 31 }; |
| 31 | 32 |
| 32 explicit EnterpriseEnrollmentUI(TabContents* contents); | 33 explicit EnterpriseEnrollmentUI(TabContents* contents); |
| 33 virtual ~EnterpriseEnrollmentUI(); | 34 virtual ~EnterpriseEnrollmentUI(); |
| 34 | 35 |
| 35 // Overriden from WebUI. | 36 // Overriden from WebUI. |
| 36 virtual void RenderViewCreated(RenderViewHost* render_view_host) OVERRIDE; | 37 virtual void RenderViewCreated(RenderViewHost* render_view_host) OVERRIDE; |
| 37 | 38 |
| 38 // Gets the URL for loading the UI. | 39 // Gets the URL for loading the UI. |
| 39 static GURL GetURL(); | 40 static GURL GetURL(); |
| 40 | 41 |
| 41 // Gets the controller the given |web_ui| is associated with. Returns NULL if | 42 // Gets the controller the given |web_ui| is associated with. Returns NULL if |
| 42 // there is no controller set. | 43 // there is no controller set. |
| 43 static Controller* GetController(WebUI* web_ui); | 44 static Controller* GetController(WebUI* web_ui); |
| 44 | 45 |
| 45 // Sets the controller on a tab contents. | 46 // Sets the controller on a tab contents. |
| 46 static void SetController(TabContents* contents, Controller* controller); | 47 static void SetController(TabContents* contents, Controller* controller); |
| 47 | 48 |
| 48 private: | 49 private: |
| 49 DISALLOW_COPY_AND_ASSIGN(EnterpriseEnrollmentUI); | 50 DISALLOW_COPY_AND_ASSIGN(EnterpriseEnrollmentUI); |
| 50 }; | 51 }; |
| 51 | 52 |
| 52 } // namespace chromeos | 53 } // namespace chromeos |
| 53 | 54 |
| 54 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_ENTERPRISE_ENROLLMENT_UI_H_ | 55 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_ENTERPRISE_ENROLLMENT_UI_H_ |
| OLD | NEW |