| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
| 10 #include "ash/wm/screen_dimmer.h" | 10 #include "ash/wm/screen_dimmer.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 85 |
| 86 OobeScreen kDimOverlayScreenIds[] = { | 86 OobeScreen kDimOverlayScreenIds[] = { |
| 87 OobeScreen::SCREEN_CONFIRM_PASSWORD, | 87 OobeScreen::SCREEN_CONFIRM_PASSWORD, |
| 88 OobeScreen::SCREEN_GAIA_SIGNIN, | 88 OobeScreen::SCREEN_GAIA_SIGNIN, |
| 89 OobeScreen::SCREEN_OOBE_ENROLLMENT, | 89 OobeScreen::SCREEN_OOBE_ENROLLMENT, |
| 90 OobeScreen::SCREEN_PASSWORD_CHANGED, | 90 OobeScreen::SCREEN_PASSWORD_CHANGED, |
| 91 OobeScreen::SCREEN_USER_IMAGE_PICKER | 91 OobeScreen::SCREEN_USER_IMAGE_PICKER |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 const char kStringsJSPath[] = "strings.js"; | 94 const char kStringsJSPath[] = "strings.js"; |
| 95 const char kLockJSPath[] = "lock.js"; |
| 95 const char kLoginJSPath[] = "login.js"; | 96 const char kLoginJSPath[] = "login.js"; |
| 96 const char kOobeJSPath[] = "oobe.js"; | 97 const char kOobeJSPath[] = "oobe.js"; |
| 97 const char kKeyboardUtilsJSPath[] = "keyboard_utils.js"; | 98 const char kKeyboardUtilsJSPath[] = "keyboard_utils.js"; |
| 98 const char kCustomElementsHTMLPath[] = "custom_elements.html"; | 99 const char kCustomElementsHTMLPath[] = "custom_elements.html"; |
| 99 const char kCustomElementsJSPath[] = "custom_elements.js"; | 100 const char kCustomElementsJSPath[] = "custom_elements.js"; |
| 100 | 101 |
| 101 // Paths for deferred resource loading. | 102 // Paths for deferred resource loading. |
| 102 const char kEnrollmentHTMLPath[] = "enrollment.html"; | 103 const char kEnrollmentHTMLPath[] = "enrollment.html"; |
| 103 const char kEnrollmentCSSPath[] = "enrollment.css"; | 104 const char kEnrollmentCSSPath[] = "enrollment.css"; |
| 104 const char kEnrollmentJSPath[] = "enrollment.js"; | 105 const char kEnrollmentJSPath[] = "enrollment.js"; |
| 105 | 106 |
| 106 // Creates a WebUIDataSource for chrome://oobe | 107 // Creates a WebUIDataSource for chrome://oobe |
| 107 content::WebUIDataSource* CreateOobeUIDataSource( | 108 content::WebUIDataSource* CreateOobeUIDataSource( |
| 108 const base::DictionaryValue& localized_strings, | 109 const base::DictionaryValue& localized_strings, |
| 109 const std::string& display_type) { | 110 const std::string& display_type) { |
| 110 content::WebUIDataSource* source = | 111 content::WebUIDataSource* source = |
| 111 content::WebUIDataSource::Create(chrome::kChromeUIOobeHost); | 112 content::WebUIDataSource::Create(chrome::kChromeUIOobeHost); |
| 112 source->AddLocalizedStrings(localized_strings); | 113 source->AddLocalizedStrings(localized_strings); |
| 113 source->SetJsonPath(kStringsJSPath); | 114 source->SetJsonPath(kStringsJSPath); |
| 114 | 115 |
| 115 if (display_type == OobeUI::kOobeDisplay) { | 116 if (display_type == OobeUI::kOobeDisplay) { |
| 116 source->SetDefaultResource(IDR_OOBE_HTML); | 117 source->SetDefaultResource(IDR_OOBE_HTML); |
| 117 source->AddResourcePath(kOobeJSPath, IDR_OOBE_JS); | 118 source->AddResourcePath(kOobeJSPath, IDR_OOBE_JS); |
| 118 source->AddResourcePath(kCustomElementsHTMLPath, | 119 source->AddResourcePath(kCustomElementsHTMLPath, |
| 119 IDR_CUSTOM_ELEMENTS_OOBE_HTML); | 120 IDR_CUSTOM_ELEMENTS_OOBE_HTML); |
| 120 source->AddResourcePath(kCustomElementsJSPath, IDR_CUSTOM_ELEMENTS_OOBE_JS); | 121 source->AddResourcePath(kCustomElementsJSPath, IDR_CUSTOM_ELEMENTS_OOBE_JS); |
| 122 } else if (display_type == OobeUI::kLockDisplay) { |
| 123 source->SetDefaultResource(IDR_LOCK_HTML); |
| 124 source->AddResourcePath(kLockJSPath, IDR_LOCK_JS); |
| 125 source->AddResourcePath(kCustomElementsHTMLPath, |
| 126 IDR_CUSTOM_ELEMENTS_LOCK_HTML); |
| 127 source->AddResourcePath(kCustomElementsJSPath, IDR_CUSTOM_ELEMENTS_LOCK_JS); |
| 121 } else { | 128 } else { |
| 122 source->SetDefaultResource(IDR_LOGIN_HTML); | 129 source->SetDefaultResource(IDR_LOGIN_HTML); |
| 123 source->AddResourcePath(kLoginJSPath, IDR_LOGIN_JS); | 130 source->AddResourcePath(kLoginJSPath, IDR_LOGIN_JS); |
| 124 source->AddResourcePath(kCustomElementsHTMLPath, | 131 source->AddResourcePath(kCustomElementsHTMLPath, |
| 125 IDR_CUSTOM_ELEMENTS_LOGIN_HTML); | 132 IDR_CUSTOM_ELEMENTS_LOGIN_HTML); |
| 126 source->AddResourcePath(kCustomElementsJSPath, | 133 source->AddResourcePath(kCustomElementsJSPath, |
| 127 IDR_CUSTOM_ELEMENTS_LOGIN_JS); | 134 IDR_CUSTOM_ELEMENTS_LOGIN_JS); |
| 128 } | 135 } |
| 129 source->AddResourcePath(kKeyboardUtilsJSPath, IDR_KEYBOARD_UTILS_JS); | 136 source->AddResourcePath(kKeyboardUtilsJSPath, IDR_KEYBOARD_UTILS_JS); |
| 130 source->OverrideContentSecurityPolicyFrameSrc( | 137 source->OverrideContentSecurityPolicyFrameSrc( |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 567 screen_dimmer->set_at_bottom(true); | 574 screen_dimmer->set_at_bottom(true); |
| 568 screen_dimmer->SetDimming(should_dim); | 575 screen_dimmer->SetDimming(should_dim); |
| 569 | 576 |
| 570 FOR_EACH_OBSERVER(Observer, | 577 FOR_EACH_OBSERVER(Observer, |
| 571 observer_list_, | 578 observer_list_, |
| 572 OnCurrentScreenChanged(current_screen_, new_screen)); | 579 OnCurrentScreenChanged(current_screen_, new_screen)); |
| 573 current_screen_ = new_screen; | 580 current_screen_ = new_screen; |
| 574 } | 581 } |
| 575 | 582 |
| 576 } // namespace chromeos | 583 } // namespace chromeos |
| OLD | NEW |