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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 OobeUI* oobe_ui_; | 87 OobeUI* oobe_ui_; |
88 | 88 |
89 DISALLOW_COPY_AND_ASSIGN(CoreOobeHandler); | 89 DISALLOW_COPY_AND_ASSIGN(CoreOobeHandler); |
90 }; | 90 }; |
91 | 91 |
92 // OobeUIHTMLSource ------------------------------------------------------- | 92 // OobeUIHTMLSource ------------------------------------------------------- |
93 | 93 |
94 OobeUIHTMLSource::OobeUIHTMLSource(DictionaryValue* localized_strings) | 94 OobeUIHTMLSource::OobeUIHTMLSource(DictionaryValue* localized_strings) |
95 : DataSource(chrome::kChromeUIOobeHost, MessageLoop::current()), | 95 : DataSource(chrome::kChromeUIOobeHost, MessageLoop::current()), |
96 localized_strings_(localized_strings) { | 96 localized_strings_(localized_strings) { |
97 SetFontAndTextDirection(localized_strings_.get()); | |
98 } | 97 } |
99 | 98 |
100 void OobeUIHTMLSource::StartDataRequest(const std::string& path, | 99 void OobeUIHTMLSource::StartDataRequest(const std::string& path, |
101 bool is_incognito, | 100 bool is_incognito, |
102 int request_id) { | 101 int request_id) { |
103 static const base::StringPiece html( | 102 static const base::StringPiece html( |
104 ResourceBundle::GetSharedInstance().GetRawDataResource(IDR_OOBE_HTML)); | 103 ResourceBundle::GetSharedInstance().GetRawDataResource(IDR_OOBE_HTML)); |
105 | 104 |
106 const std::string& full_html = jstemplate_builder::GetI18nTemplateHtml( | 105 const std::string& full_html = jstemplate_builder::GetI18nTemplateHtml( |
107 html, localized_strings_.get()); | 106 html, localized_strings_.get()); |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 NOTIMPLEMENTED(); | 207 NOTIMPLEMENTED(); |
209 return NULL; | 208 return NULL; |
210 } | 209 } |
211 | 210 |
212 void OobeUI::GetLocalizedStrings(DictionaryValue* localized_strings) { | 211 void OobeUI::GetLocalizedStrings(DictionaryValue* localized_strings) { |
213 // Note, handlers_[0] is a GenericHandler used by the WebUI. | 212 // Note, handlers_[0] is a GenericHandler used by the WebUI. |
214 for (size_t i = 1; i < handlers_.size(); ++i) { | 213 for (size_t i = 1; i < handlers_.size(); ++i) { |
215 static_cast<OobeMessageHandler*>(handlers_[i])-> | 214 static_cast<OobeMessageHandler*>(handlers_[i])-> |
216 GetLocalizedStrings(localized_strings); | 215 GetLocalizedStrings(localized_strings); |
217 } | 216 } |
| 217 ChromeURLDataManager::DataSource::SetFontAndTextDirection(localized_strings); |
218 } | 218 } |
219 | 219 |
220 void OobeUI::AddOobeMessageHandler(OobeMessageHandler* handler) { | 220 void OobeUI::AddOobeMessageHandler(OobeMessageHandler* handler) { |
221 AddMessageHandler(handler->Attach(this)); | 221 AddMessageHandler(handler->Attach(this)); |
222 } | 222 } |
223 | 223 |
224 void OobeUI::InitializeHandlers() { | 224 void OobeUI::InitializeHandlers() { |
225 // Note, handlers_[0] is a GenericHandler used by the WebUI. | 225 // Note, handlers_[0] is a GenericHandler used by the WebUI. |
226 for (size_t i = 1; i < handlers_.size(); ++i) { | 226 for (size_t i = 1; i < handlers_.size(); ++i) { |
227 static_cast<OobeMessageHandler*>(handlers_[i])->InitializeBase(); | 227 static_cast<OobeMessageHandler*>(handlers_[i])->InitializeBase(); |
228 } | 228 } |
229 } | 229 } |
230 | 230 |
231 } // namespace chromeos | 231 } // namespace chromeos |
OLD | NEW |