| 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 #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/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/ref_counted_memory.h" | 10 #include "base/memory/ref_counted_memory.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 : DataSource(chrome::kChromeUIOobeHost, MessageLoop::current()), | 90 : DataSource(chrome::kChromeUIOobeHost, MessageLoop::current()), |
| 91 localized_strings_(localized_strings) { | 91 localized_strings_(localized_strings) { |
| 92 } | 92 } |
| 93 | 93 |
| 94 void OobeUIHTMLSource::StartDataRequest(const std::string& path, | 94 void OobeUIHTMLSource::StartDataRequest(const std::string& path, |
| 95 bool is_incognito, | 95 bool is_incognito, |
| 96 int request_id) { | 96 int request_id) { |
| 97 static const base::StringPiece html( | 97 static const base::StringPiece html( |
| 98 ResourceBundle::GetSharedInstance().GetRawDataResource(IDR_OOBE_HTML)); | 98 ResourceBundle::GetSharedInstance().GetRawDataResource(IDR_OOBE_HTML)); |
| 99 | 99 |
| 100 const std::string& full_html = jstemplate_builder::GetI18nTemplateHtml( | 100 std::string full_html = jstemplate_builder::GetI18nTemplateHtml( |
| 101 html, localized_strings_.get()); | 101 html, localized_strings_.get()); |
| 102 | 102 |
| 103 scoped_refptr<RefCountedBytes> html_bytes(new RefCountedBytes()); | 103 SendResponse(request_id, base::RefCountedString::TakeString(&full_html)); |
| 104 html_bytes->data.resize(full_html.size()); | |
| 105 std::copy(full_html.begin(), full_html.end(), html_bytes->data.begin()); | |
| 106 | |
| 107 SendResponse(request_id, html_bytes); | |
| 108 } | 104 } |
| 109 | 105 |
| 110 // CoreOobeHandler ------------------------------------------------------------ | 106 // CoreOobeHandler ------------------------------------------------------------ |
| 111 | 107 |
| 112 CoreOobeHandler::CoreOobeHandler(OobeUI* oobe_ui) | 108 CoreOobeHandler::CoreOobeHandler(OobeUI* oobe_ui) |
| 113 : oobe_ui_(oobe_ui) { | 109 : oobe_ui_(oobe_ui) { |
| 114 } | 110 } |
| 115 | 111 |
| 116 CoreOobeHandler::~CoreOobeHandler() { | 112 CoreOobeHandler::~CoreOobeHandler() { |
| 117 } | 113 } |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 for (size_t i = 1; i < handlers_.size(); ++i) { | 234 for (size_t i = 1; i < handlers_.size(); ++i) { |
| 239 static_cast<BaseScreenHandler*>(handlers_[i])->InitializeBase(); | 235 static_cast<BaseScreenHandler*>(handlers_[i])->InitializeBase(); |
| 240 } | 236 } |
| 241 } | 237 } |
| 242 | 238 |
| 243 void OobeUI::ShowSigninScreen() { | 239 void OobeUI::ShowSigninScreen() { |
| 244 signin_screen_handler_->Show(); | 240 signin_screen_handler_->Show(); |
| 245 } | 241 } |
| 246 | 242 |
| 247 } // namespace chromeos | 243 } // namespace chromeos |
| OLD | NEW |