| 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 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" | 28 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" |
| 29 #include "chrome/browser/ui/webui/chromeos/login/update_screen_handler.h" | 29 #include "chrome/browser/ui/webui/chromeos/login/update_screen_handler.h" |
| 30 #include "chrome/browser/ui/webui/chromeos/login/user_image_screen_handler.h" | 30 #include "chrome/browser/ui/webui/chromeos/login/user_image_screen_handler.h" |
| 31 #include "chrome/browser/ui/webui/options2/chromeos/user_image_source2.h" | 31 #include "chrome/browser/ui/webui/options2/chromeos/user_image_source2.h" |
| 32 #include "chrome/browser/ui/webui/theme_source.h" | 32 #include "chrome/browser/ui/webui/theme_source.h" |
| 33 #include "chrome/common/jstemplate_builder.h" | 33 #include "chrome/common/jstemplate_builder.h" |
| 34 #include "chrome/common/url_constants.h" | 34 #include "chrome/common/url_constants.h" |
| 35 #include "content/public/browser/web_contents.h" | 35 #include "content/public/browser/web_contents.h" |
| 36 #include "content/public/browser/web_ui.h" | 36 #include "content/public/browser/web_ui.h" |
| 37 #include "grit/browser_resources.h" | 37 #include "grit/browser_resources.h" |
| 38 #include "ui/base/layout.h" |
| 38 #include "ui/base/resource/resource_bundle.h" | 39 #include "ui/base/resource/resource_bundle.h" |
| 39 | 40 |
| 40 using content::WebContents; | 41 using content::WebContents; |
| 41 | 42 |
| 42 namespace { | 43 namespace { |
| 43 | 44 |
| 44 // Path for a stripped down login page that does not have OOBE elements. | 45 // Path for a stripped down login page that does not have OOBE elements. |
| 45 const char kLoginPath[] = "login"; | 46 const char kLoginPath[] = "login"; |
| 46 | 47 |
| 47 // Path for the enterprise enrollment gaia page hosting. | 48 // Path for the enterprise enrollment gaia page hosting. |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 else if (path == kLoginPath) | 101 else if (path == kLoginPath) |
| 101 response = GetDataResource(IDR_LOGIN_HTML); | 102 response = GetDataResource(IDR_LOGIN_HTML); |
| 102 else if (path == kEnterpriseEnrollmentGaiaLoginPath) | 103 else if (path == kEnterpriseEnrollmentGaiaLoginPath) |
| 103 response = GetDataResource(IDR_GAIA_LOGIN_HTML); | 104 response = GetDataResource(IDR_GAIA_LOGIN_HTML); |
| 104 | 105 |
| 105 SendResponse(request_id, base::RefCountedString::TakeString(&response)); | 106 SendResponse(request_id, base::RefCountedString::TakeString(&response)); |
| 106 } | 107 } |
| 107 | 108 |
| 108 std::string OobeUIHTMLSource::GetDataResource(int resource_id) const { | 109 std::string OobeUIHTMLSource::GetDataResource(int resource_id) const { |
| 109 const base::StringPiece html( | 110 const base::StringPiece html( |
| 110 ResourceBundle::GetSharedInstance().GetRawDataResource(resource_id)); | 111 ResourceBundle::GetSharedInstance().GetRawDataResource( |
| 112 resource_id, ui::kScaleFactorNone)); |
| 111 return jstemplate_builder::GetI18nTemplateHtml(html, | 113 return jstemplate_builder::GetI18nTemplateHtml(html, |
| 112 localized_strings_.get()); | 114 localized_strings_.get()); |
| 113 } | 115 } |
| 114 | 116 |
| 115 // OobeUI ---------------------------------------------------------------------- | 117 // OobeUI ---------------------------------------------------------------------- |
| 116 | 118 |
| 117 OobeUI::OobeUI(content::WebUI* web_ui) | 119 OobeUI::OobeUI(content::WebUI* web_ui) |
| 118 : WebUIController(web_ui), | 120 : WebUIController(web_ui), |
| 119 update_screen_actor_(NULL), | 121 update_screen_actor_(NULL), |
| 120 network_screen_actor_(NULL), | 122 network_screen_actor_(NULL), |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 | 250 |
| 249 void OobeUI::ResetSigninScreenHandlerDelegate() { | 251 void OobeUI::ResetSigninScreenHandlerDelegate() { |
| 250 signin_screen_handler_->SetDelegate(NULL); | 252 signin_screen_handler_->SetDelegate(NULL); |
| 251 } | 253 } |
| 252 | 254 |
| 253 void OobeUI::OnLoginPromptVisible() { | 255 void OobeUI::OnLoginPromptVisible() { |
| 254 user_image_screen_actor_->CheckCameraPresence(); | 256 user_image_screen_actor_->CheckCameraPresence(); |
| 255 } | 257 } |
| 256 | 258 |
| 257 } // namespace chromeos | 259 } // namespace chromeos |
| OLD | NEW |