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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 | 173 |
174 // Set up the chrome://oobe/ source. | 174 // Set up the chrome://oobe/ source. |
175 OobeUIHTMLSource* html_source = new OobeUIHTMLSource(localized_strings); | 175 OobeUIHTMLSource* html_source = new OobeUIHTMLSource(localized_strings); |
176 ChromeURLDataManager::AddDataSource(profile, html_source); | 176 ChromeURLDataManager::AddDataSource(profile, html_source); |
177 | 177 |
178 // Set up the chrome://userimage/ source. | 178 // Set up the chrome://userimage/ source. |
179 options2::UserImageSource* user_image_source = | 179 options2::UserImageSource* user_image_source = |
180 new options2::UserImageSource(); | 180 new options2::UserImageSource(); |
181 ChromeURLDataManager::AddDataSource(profile, user_image_source); | 181 ChromeURLDataManager::AddDataSource(profile, user_image_source); |
182 | 182 |
183 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableNewOobe)) { | 183 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableNewOobe)) { |
184 // Set up the chrome://wallpaper/ source. | 184 // Set up the chrome://wallpaper/ source. |
185 chromeos::options2::WallpaperImageSource* wallpaper_image_source = | 185 chromeos::options2::WallpaperImageSource* wallpaper_image_source = |
186 new chromeos::options2::WallpaperImageSource(); | 186 new chromeos::options2::WallpaperImageSource(); |
187 ChromeURLDataManager::AddDataSource(profile, wallpaper_image_source); | 187 ChromeURLDataManager::AddDataSource(profile, wallpaper_image_source); |
188 } | 188 } |
189 } | 189 } |
190 | 190 |
191 OobeUI::~OobeUI() { | 191 OobeUI::~OobeUI() { |
192 } | 192 } |
193 | 193 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 NOTREACHED(); | 231 NOTREACHED(); |
232 return NULL; | 232 return NULL; |
233 } | 233 } |
234 | 234 |
235 void OobeUI::GetLocalizedStrings(base::DictionaryValue* localized_strings) { | 235 void OobeUI::GetLocalizedStrings(base::DictionaryValue* localized_strings) { |
236 // Note, handlers_[0] is a GenericHandler used by the WebUI. | 236 // Note, handlers_[0] is a GenericHandler used by the WebUI. |
237 for (size_t i = 0; i < handlers_.size(); ++i) | 237 for (size_t i = 0; i < handlers_.size(); ++i) |
238 handlers_[i]->GetLocalizedStrings(localized_strings); | 238 handlers_[i]->GetLocalizedStrings(localized_strings); |
239 ChromeURLDataManager::DataSource::SetFontAndTextDirection(localized_strings); | 239 ChromeURLDataManager::DataSource::SetFontAndTextDirection(localized_strings); |
240 | 240 |
241 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableNewOobe)) | 241 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableNewOobe)) |
242 localized_strings->SetString("oobeType", "new"); | 242 localized_strings->SetString("oobeType", "new"); |
243 else | 243 else |
244 localized_strings->SetString("oobeType", "old"); | 244 localized_strings->SetString("oobeType", "old"); |
245 | 245 |
246 // OobeUI is used for OOBE/login and lock screen. | 246 // OobeUI is used for OOBE/login and lock screen. |
247 if (BaseLoginDisplayHost::default_host()) | 247 if (BaseLoginDisplayHost::default_host()) |
248 localized_strings->SetString("screenType", "login"); | 248 localized_strings->SetString("screenType", "login"); |
249 else | 249 else |
250 localized_strings->SetString("screenType", "lock"); | 250 localized_strings->SetString("screenType", "lock"); |
251 } | 251 } |
(...skipping 19 matching lines...) Expand all Loading... |
271 | 271 |
272 void OobeUI::ResetSigninScreenHandlerDelegate() { | 272 void OobeUI::ResetSigninScreenHandlerDelegate() { |
273 signin_screen_handler_->SetDelegate(NULL); | 273 signin_screen_handler_->SetDelegate(NULL); |
274 } | 274 } |
275 | 275 |
276 void OobeUI::OnLoginPromptVisible() { | 276 void OobeUI::OnLoginPromptVisible() { |
277 user_image_screen_actor_->CheckCameraPresence(); | 277 user_image_screen_actor_->CheckCameraPresence(); |
278 } | 278 } |
279 | 279 |
280 } // namespace chromeos | 280 } // namespace chromeos |
OLD | NEW |