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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 OobeUI::kLockDisplay, | 65 OobeUI::kLockDisplay, |
66 OobeUI::kUserAddingDisplay, | 66 OobeUI::kUserAddingDisplay, |
67 OobeUI::kAppLaunchSplashDisplay | 67 OobeUI::kAppLaunchSplashDisplay |
68 }; | 68 }; |
69 | 69 |
70 const char kStringsJSPath[] = "strings.js"; | 70 const char kStringsJSPath[] = "strings.js"; |
71 const char kLoginJSPath[] = "login.js"; | 71 const char kLoginJSPath[] = "login.js"; |
72 const char kOobeJSPath[] = "oobe.js"; | 72 const char kOobeJSPath[] = "oobe.js"; |
73 const char kKeyboardUtilsJSPath[] = "keyboard_utils.js"; | 73 const char kKeyboardUtilsJSPath[] = "keyboard_utils.js"; |
74 const char kDemoUserLoginJSPath[] = "demo_user_login.js"; | 74 const char kDemoUserLoginJSPath[] = "demo_user_login.js"; |
| 75 const char kCustomElementsHTMLPath[] = "custom_elements.html"; |
| 76 const char kCustomElementsJSPath[] = "custom_elements.js"; |
75 | 77 |
76 // Paths for deferred resource loading. | 78 // Paths for deferred resource loading. |
77 const char kEnrollmentHTMLPath[] = "enrollment.html"; | 79 const char kEnrollmentHTMLPath[] = "enrollment.html"; |
78 const char kEnrollmentCSSPath[] = "enrollment.css"; | 80 const char kEnrollmentCSSPath[] = "enrollment.css"; |
79 const char kEnrollmentJSPath[] = "enrollment.js"; | 81 const char kEnrollmentJSPath[] = "enrollment.js"; |
80 | 82 |
| 83 |
81 void AddPolymerResourcesPaths(content::WebUIDataSource* source) { | 84 void AddPolymerResourcesPaths(content::WebUIDataSource* source) { |
82 for (const auto& mapping: GetPolymerResourcesMap()) | 85 for (const auto& mapping: GetPolymerResourcesMap()) |
83 source->AddResourcePath(mapping.first, mapping.second); | 86 source->AddResourcePath(mapping.first, mapping.second); |
84 } | 87 } |
85 | 88 |
86 // Creates a WebUIDataSource for chrome://oobe | 89 // Creates a WebUIDataSource for chrome://oobe |
87 content::WebUIDataSource* CreateOobeUIDataSource( | 90 content::WebUIDataSource* CreateOobeUIDataSource( |
88 const base::DictionaryValue& localized_strings, | 91 const base::DictionaryValue& localized_strings, |
89 const std::string& display_type) { | 92 const std::string& display_type) { |
90 content::WebUIDataSource* source = | 93 content::WebUIDataSource* source = |
(...skipping 19 matching lines...) Expand all Loading... |
110 "frame-src chrome://terms/ %s/;", | 113 "frame-src chrome://terms/ %s/;", |
111 extensions::kGaiaAuthExtensionOrigin)); | 114 extensions::kGaiaAuthExtensionOrigin)); |
112 | 115 |
113 // Serve deferred resources. | 116 // Serve deferred resources. |
114 source->AddResourcePath(kEnrollmentHTMLPath, IDR_OOBE_ENROLLMENT_HTML); | 117 source->AddResourcePath(kEnrollmentHTMLPath, IDR_OOBE_ENROLLMENT_HTML); |
115 source->AddResourcePath(kEnrollmentCSSPath, IDR_OOBE_ENROLLMENT_CSS); | 118 source->AddResourcePath(kEnrollmentCSSPath, IDR_OOBE_ENROLLMENT_CSS); |
116 source->AddResourcePath(kEnrollmentJSPath, IDR_OOBE_ENROLLMENT_JS); | 119 source->AddResourcePath(kEnrollmentJSPath, IDR_OOBE_ENROLLMENT_JS); |
117 | 120 |
118 if (display_type == OobeUI::kOobeDisplay) { | 121 if (display_type == OobeUI::kOobeDisplay) { |
119 AddPolymerResourcesPaths(source); | 122 AddPolymerResourcesPaths(source); |
| 123 source->AddResourcePath(kCustomElementsHTMLPath, IDR_CUSTOM_ELEMENTS_HTML); |
| 124 source->AddResourcePath(kCustomElementsJSPath, IDR_CUSTOM_ELEMENTS_JS); |
| 125 |
120 source->AddResourcePath("Roboto-Thin.ttf", IDR_FONT_ROBOTO_THIN); | 126 source->AddResourcePath("Roboto-Thin.ttf", IDR_FONT_ROBOTO_THIN); |
121 source->AddResourcePath("Roboto-Light.ttf", IDR_FONT_ROBOTO_LIGHT); | 127 source->AddResourcePath("Roboto-Light.ttf", IDR_FONT_ROBOTO_LIGHT); |
| 128 source->AddResourcePath("Roboto-Regular.ttf", IDR_FONT_ROBOTO_REGULAR); |
| 129 source->AddResourcePath("Roboto-Medium.ttf", IDR_FONT_ROBOTO_MEDIUM); |
122 source->AddResourcePath("Roboto-Bold.ttf", IDR_FONT_ROBOTO_BOLD); | 130 source->AddResourcePath("Roboto-Bold.ttf", IDR_FONT_ROBOTO_BOLD); |
123 } | 131 } |
124 | 132 |
125 return source; | 133 return source; |
126 } | 134 } |
127 | 135 |
128 std::string GetDisplayType(const GURL& url) { | 136 std::string GetDisplayType(const GURL& url) { |
129 std::string path = url.path().size() ? url.path().substr(1) : ""; | 137 std::string path = url.path().size() ? url.path().substr(1) : ""; |
130 if (std::find(kKnownDisplayTypes, | 138 if (std::find(kKnownDisplayTypes, |
131 kKnownDisplayTypes + arraysize(kKnownDisplayTypes), | 139 kKnownDisplayTypes + arraysize(kKnownDisplayTypes), |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 DCHECK(screen_ids_.count(screen)) | 563 DCHECK(screen_ids_.count(screen)) |
556 << "Screen should be registered in InitializeScreenMaps()"; | 564 << "Screen should be registered in InitializeScreenMaps()"; |
557 Screen new_screen = screen_ids_[screen]; | 565 Screen new_screen = screen_ids_[screen]; |
558 FOR_EACH_OBSERVER(Observer, | 566 FOR_EACH_OBSERVER(Observer, |
559 observer_list_, | 567 observer_list_, |
560 OnCurrentScreenChanged(current_screen_, new_screen)); | 568 OnCurrentScreenChanged(current_screen_, new_screen)); |
561 current_screen_ = new_screen; | 569 current_screen_ = new_screen; |
562 } | 570 } |
563 | 571 |
564 } // namespace chromeos | 572 } // namespace chromeos |
OLD | NEW |