| 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_CHROMEOS_LOGIN_REGISTRATION_SCREEN_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_REGISTRATION_SCREEN_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_REGISTRATION_SCREEN_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_REGISTRATION_SCREEN_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 class ViewScreenDelegate; | 28 class ViewScreenDelegate; |
| 29 | 29 |
| 30 // Class that renders host registration page. | 30 // Class that renders host registration page. |
| 31 class RegistrationDomView : public WebPageDomView { | 31 class RegistrationDomView : public WebPageDomView { |
| 32 public: | 32 public: |
| 33 RegistrationDomView() {} | 33 RegistrationDomView() {} |
| 34 | 34 |
| 35 protected: | 35 protected: |
| 36 // Overriden from DOMView: | 36 // Overriden from DOMView: |
| 37 virtual TabContents* CreateTabContents(Profile* profile, | 37 virtual TabContents* CreateTabContents(Profile* profile, |
| 38 SiteInstance* instance); | 38 SiteInstance* instance) OVERRIDE; |
| 39 | 39 |
| 40 DISALLOW_COPY_AND_ASSIGN(RegistrationDomView); | 40 DISALLOW_COPY_AND_ASSIGN(RegistrationDomView); |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 // Class that displays screen contents: page and throbber while waiting. | 43 // Class that displays screen contents: page and throbber while waiting. |
| 44 class RegistrationView : public WebPageView { | 44 class RegistrationView : public WebPageView { |
| 45 public: | 45 public: |
| 46 RegistrationView() : dom_view_(new RegistrationDomView()) {} | 46 RegistrationView() : dom_view_(new RegistrationDomView()) {} |
| 47 | 47 |
| 48 protected: | 48 protected: |
| 49 virtual WebPageDomView* dom_view(); | 49 virtual WebPageDomView* dom_view() OVERRIDE; |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 // View that renders page. | 52 // View that renders page. |
| 53 RegistrationDomView* dom_view_; | 53 RegistrationDomView* dom_view_; |
| 54 | 54 |
| 55 DISALLOW_COPY_AND_ASSIGN(RegistrationView); | 55 DISALLOW_COPY_AND_ASSIGN(RegistrationView); |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 // RegistrationScreen represents screen that is shown during OOBE. | 58 // RegistrationScreen represents screen that is shown during OOBE. |
| 59 // It renders host page served from resources that includes iframe with | 59 // It renders host page served from resources that includes iframe with |
| 60 // registration page specified in the startup customization manifest. | 60 // registration page specified in the startup customization manifest. |
| 61 // Partner registration page notifies host page on registration result. | 61 // Partner registration page notifies host page on registration result. |
| 62 // Host page notifies that back to RegistrationScreen. | 62 // Host page notifies that back to RegistrationScreen. |
| 63 class RegistrationScreen : public ViewScreen<RegistrationView>, | 63 class RegistrationScreen : public ViewScreen<RegistrationView>, |
| 64 public WebPageScreen, | 64 public WebPageScreen, |
| 65 public WebPageDelegate { | 65 public WebPageDelegate { |
| 66 public: | 66 public: |
| 67 explicit RegistrationScreen(ViewScreenDelegate* delegate); | 67 explicit RegistrationScreen(ViewScreenDelegate* delegate); |
| 68 | 68 |
| 69 // WebPageDelegate implementation: | 69 // WebPageDelegate implementation: |
| 70 virtual void OnPageLoaded() OVERRIDE; | 70 virtual void OnPageLoaded() OVERRIDE; |
| 71 virtual void OnPageLoadFailed(const std::string& url) OVERRIDE; | 71 virtual void OnPageLoadFailed(const std::string& url) OVERRIDE; |
| 72 | 72 |
| 73 // Handler factory for net::URLRequestFilter::AddHostnameHandler. | 73 // Handler factory for net::URLRequestFilter::AddHostnameHandler. |
| 74 static net::URLRequestJob* Factory(net::URLRequest* request, | 74 static net::URLRequestJob* Factory(net::URLRequest* request, |
| 75 const std::string& scheme); | 75 const std::string& scheme); |
| 76 | 76 |
| 77 private: | 77 private: |
| 78 // ViewScreen implementation: | 78 // ViewScreen implementation: |
| 79 virtual void CreateView(); | 79 virtual void CreateView() OVERRIDE; |
| 80 virtual void Refresh(); | 80 virtual void Refresh() OVERRIDE; |
| 81 virtual RegistrationView* AllocateView(); | 81 virtual RegistrationView* AllocateView() OVERRIDE; |
| 82 | 82 |
| 83 // TabContentsDelegate implementation: | 83 // TabContentsDelegate implementation: |
| 84 // Deprecated. Please use two-argument variant. | 84 // Deprecated. Please use two-argument variant. |
| 85 // TODO(adriansc): Remove this method once refactoring changed all call sites. | 85 // TODO(adriansc): Remove this method once refactoring changed all call sites. |
| 86 virtual TabContents* OpenURLFromTab( | 86 virtual TabContents* OpenURLFromTab( |
| 87 TabContents* source, | 87 TabContents* source, |
| 88 const GURL& url, | 88 const GURL& url, |
| 89 const GURL& referrer, | 89 const GURL& referrer, |
| 90 WindowOpenDisposition disposition, | 90 WindowOpenDisposition disposition, |
| 91 content::PageTransition transition) OVERRIDE; | 91 content::PageTransition transition) OVERRIDE; |
| 92 virtual TabContents* OpenURLFromTab(TabContents* source, | 92 virtual TabContents* OpenURLFromTab(TabContents* source, |
| 93 const OpenURLParams& params) OVERRIDE; | 93 const OpenURLParams& params) OVERRIDE; |
| 94 | 94 |
| 95 virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event); | 95 virtual void HandleKeyboardEvent( |
| 96 const NativeWebKeyboardEvent& event) OVERRIDE; |
| 96 | 97 |
| 97 // WebPageScreen implementation: | 98 // WebPageScreen implementation: |
| 98 virtual void CloseScreen(ScreenObserver::ExitCodes code); | 99 virtual void CloseScreen(ScreenObserver::ExitCodes code) OVERRIDE; |
| 99 | 100 |
| 100 DISALLOW_COPY_AND_ASSIGN(RegistrationScreen); | 101 DISALLOW_COPY_AND_ASSIGN(RegistrationScreen); |
| 101 }; | 102 }; |
| 102 | 103 |
| 103 } // namespace chromeos | 104 } // namespace chromeos |
| 104 | 105 |
| 105 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_REGISTRATION_SCREEN_H_ | 106 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_REGISTRATION_SCREEN_H_ |
| OLD | NEW |