| 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 12 matching lines...) Expand all Loading... |
| 23 #include "chrome/browser/ui/webui/chromeos/login/core_oobe_handler.h" | 23 #include "chrome/browser/ui/webui/chromeos/login/core_oobe_handler.h" |
| 24 #include "chrome/browser/ui/webui/chromeos/login/enterprise_oauth_enrollment_scr
een_handler.h" | 24 #include "chrome/browser/ui/webui/chromeos/login/enterprise_oauth_enrollment_scr
een_handler.h" |
| 25 #include "chrome/browser/ui/webui/chromeos/login/eula_screen_handler.h" | 25 #include "chrome/browser/ui/webui/chromeos/login/eula_screen_handler.h" |
| 26 #include "chrome/browser/ui/webui/chromeos/login/network_dropdown_handler.h" | 26 #include "chrome/browser/ui/webui/chromeos/login/network_dropdown_handler.h" |
| 27 #include "chrome/browser/ui/webui/chromeos/login/network_screen_handler.h" | 27 #include "chrome/browser/ui/webui/chromeos/login/network_screen_handler.h" |
| 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/chrome_switches.h" |
| 33 #include "chrome/common/jstemplate_builder.h" | 34 #include "chrome/common/jstemplate_builder.h" |
| 34 #include "chrome/common/url_constants.h" | 35 #include "chrome/common/url_constants.h" |
| 35 #include "content/public/browser/web_contents.h" | 36 #include "content/public/browser/web_contents.h" |
| 36 #include "content/public/browser/web_ui.h" | 37 #include "content/public/browser/web_ui.h" |
| 37 #include "grit/browser_resources.h" | 38 #include "grit/browser_resources.h" |
| 38 #include "ui/base/layout.h" | 39 #include "ui/base/layout.h" |
| 39 #include "ui/base/resource/resource_bundle.h" | 40 #include "ui/base/resource/resource_bundle.h" |
| 40 | 41 |
| 41 using content::WebContents; | 42 using content::WebContents; |
| 42 | 43 |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 // without opening OOBE page. | 221 // without opening OOBE page. |
| 221 NOTREACHED(); | 222 NOTREACHED(); |
| 222 return NULL; | 223 return NULL; |
| 223 } | 224 } |
| 224 | 225 |
| 225 void OobeUI::GetLocalizedStrings(base::DictionaryValue* localized_strings) { | 226 void OobeUI::GetLocalizedStrings(base::DictionaryValue* localized_strings) { |
| 226 // Note, handlers_[0] is a GenericHandler used by the WebUI. | 227 // Note, handlers_[0] is a GenericHandler used by the WebUI. |
| 227 for (size_t i = 0; i < handlers_.size(); ++i) | 228 for (size_t i = 0; i < handlers_.size(); ++i) |
| 228 handlers_[i]->GetLocalizedStrings(localized_strings); | 229 handlers_[i]->GetLocalizedStrings(localized_strings); |
| 229 ChromeURLDataManager::DataSource::SetFontAndTextDirection(localized_strings); | 230 ChromeURLDataManager::DataSource::SetFontAndTextDirection(localized_strings); |
| 231 |
| 232 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableNewOobe)) |
| 233 localized_strings->SetString("oobeType", "new"); |
| 234 else |
| 235 localized_strings->SetString("oobeType", "old"); |
| 230 } | 236 } |
| 231 | 237 |
| 232 void OobeUI::AddScreenHandler(BaseScreenHandler* handler) { | 238 void OobeUI::AddScreenHandler(BaseScreenHandler* handler) { |
| 233 web_ui()->AddMessageHandler(handler); | 239 web_ui()->AddMessageHandler(handler); |
| 234 handlers_.push_back(handler); | 240 handlers_.push_back(handler); |
| 235 } | 241 } |
| 236 | 242 |
| 237 void OobeUI::InitializeHandlers() { | 243 void OobeUI::InitializeHandlers() { |
| 238 for (size_t i = 0; i < handlers_.size(); ++i) | 244 for (size_t i = 0; i < handlers_.size(); ++i) |
| 239 handlers_[i]->InitializeBase(); | 245 handlers_[i]->InitializeBase(); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 250 | 256 |
| 251 void OobeUI::ResetSigninScreenHandlerDelegate() { | 257 void OobeUI::ResetSigninScreenHandlerDelegate() { |
| 252 signin_screen_handler_->SetDelegate(NULL); | 258 signin_screen_handler_->SetDelegate(NULL); |
| 253 } | 259 } |
| 254 | 260 |
| 255 void OobeUI::OnLoginPromptVisible() { | 261 void OobeUI::OnLoginPromptVisible() { |
| 256 user_image_screen_actor_->CheckCameraPresence(); | 262 user_image_screen_actor_->CheckCameraPresence(); |
| 257 } | 263 } |
| 258 | 264 |
| 259 } // namespace chromeos | 265 } // namespace chromeos |
| OLD | NEW |