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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 const char kEnrollmentHTMLPath[] = "enrollment.html"; | 75 const char kEnrollmentHTMLPath[] = "enrollment.html"; |
76 const char kEnrollmentCSSPath[] = "enrollment.css"; | 76 const char kEnrollmentCSSPath[] = "enrollment.css"; |
77 const char kEnrollmentJSPath[] = "enrollment.js"; | 77 const char kEnrollmentJSPath[] = "enrollment.js"; |
78 | 78 |
79 // Creates a WebUIDataSource for chrome://oobe | 79 // Creates a WebUIDataSource for chrome://oobe |
80 content::WebUIDataSource* CreateOobeUIDataSource( | 80 content::WebUIDataSource* CreateOobeUIDataSource( |
81 const base::DictionaryValue& localized_strings, | 81 const base::DictionaryValue& localized_strings, |
82 const std::string& display_type) { | 82 const std::string& display_type) { |
83 content::WebUIDataSource* source = | 83 content::WebUIDataSource* source = |
84 content::WebUIDataSource::Create(chrome::kChromeUIOobeHost); | 84 content::WebUIDataSource::Create(chrome::kChromeUIOobeHost); |
85 source->SetUseJsonJSFormatV2(); | |
86 source->AddLocalizedStrings(localized_strings); | 85 source->AddLocalizedStrings(localized_strings); |
87 source->SetJsonPath(kStringsJSPath); | 86 source->SetJsonPath(kStringsJSPath); |
88 | 87 |
89 if (chromeos::KioskModeSettings::Get()->IsKioskModeEnabled()) { | 88 if (chromeos::KioskModeSettings::Get()->IsKioskModeEnabled()) { |
90 source->SetDefaultResource(IDR_DEMO_USER_LOGIN_HTML); | 89 source->SetDefaultResource(IDR_DEMO_USER_LOGIN_HTML); |
91 source->AddResourcePath(kDemoUserLoginJSPath, IDR_DEMO_USER_LOGIN_JS); | 90 source->AddResourcePath(kDemoUserLoginJSPath, IDR_DEMO_USER_LOGIN_JS); |
92 return source; | 91 return source; |
93 } | 92 } |
94 if (display_type == OobeUI::kOobeDisplay) { | 93 if (display_type == OobeUI::kOobeDisplay) { |
95 source->SetDefaultResource(IDR_OOBE_HTML); | 94 source->SetDefaultResource(IDR_OOBE_HTML); |
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 DCHECK(screen_ids_.count(screen)) | 541 DCHECK(screen_ids_.count(screen)) |
543 << "Screen should be registered in InitializeScreenMaps()"; | 542 << "Screen should be registered in InitializeScreenMaps()"; |
544 Screen new_screen = screen_ids_[screen]; | 543 Screen new_screen = screen_ids_[screen]; |
545 FOR_EACH_OBSERVER(Observer, | 544 FOR_EACH_OBSERVER(Observer, |
546 observer_list_, | 545 observer_list_, |
547 OnCurrentScreenChanged(current_screen_, new_screen)); | 546 OnCurrentScreenChanged(current_screen_, new_screen)); |
548 current_screen_ = new_screen; | 547 current_screen_ = new_screen; |
549 } | 548 } |
550 | 549 |
551 } // namespace chromeos | 550 } // namespace chromeos |
OLD | NEW |