Chromium Code Reviews
[email protected] (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(309)

Side by Side Diff: chrome/browser/ui/webui/chromeos/login/oobe_ui.cc

Issue 7980012: [ChromeOS] Reland - Make WebUI login use only needed resources. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 18 matching lines...) Expand all
29 #include "chrome/browser/ui/webui/theme_source.h" 29 #include "chrome/browser/ui/webui/theme_source.h"
30 #include "chrome/common/chrome_switches.h" 30 #include "chrome/common/chrome_switches.h"
31 #include "chrome/common/jstemplate_builder.h" 31 #include "chrome/common/jstemplate_builder.h"
32 #include "chrome/common/url_constants.h" 32 #include "chrome/common/url_constants.h"
33 #include "content/browser/tab_contents/tab_contents.h" 33 #include "content/browser/tab_contents/tab_contents.h"
34 #include "grit/browser_resources.h" 34 #include "grit/browser_resources.h"
35 #include "ui/base/resource/resource_bundle.h" 35 #include "ui/base/resource/resource_bundle.h"
36 36
37 namespace { 37 namespace {
38 38
39 // Path for a stripped down login page that does not have OOBE elements.
40 const char kLoginPath[] = "login";
41
39 // Path for the enterprise enrollment gaia page hosting. 42 // Path for the enterprise enrollment gaia page hosting.
40 const char kEnterpriseEnrollmentGaiaLoginPath[] = "gaialogin"; 43 const char kEnterpriseEnrollmentGaiaLoginPath[] = "gaialogin";
41 44
42 } // namespace 45 } // namespace
43 46
44 namespace chromeos { 47 namespace chromeos {
45 48
46 class OobeUIHTMLSource : public ChromeURLDataManager::DataSource { 49 class OobeUIHTMLSource : public ChromeURLDataManager::DataSource {
47 public: 50 public:
48 explicit OobeUIHTMLSource(DictionaryValue* localized_strings); 51 explicit OobeUIHTMLSource(DictionaryValue* localized_strings);
(...skipping 23 matching lines...) Expand all
72 75
73 void OobeUIHTMLSource::StartDataRequest(const std::string& path, 76 void OobeUIHTMLSource::StartDataRequest(const std::string& path,
74 bool is_incognito, 77 bool is_incognito,
75 int request_id) { 78 int request_id) {
76 std::string response; 79 std::string response;
77 if (path.empty()) { 80 if (path.empty()) {
78 static const base::StringPiece html( 81 static const base::StringPiece html(
79 ResourceBundle::GetSharedInstance().GetRawDataResource(IDR_OOBE_HTML)); 82 ResourceBundle::GetSharedInstance().GetRawDataResource(IDR_OOBE_HTML));
80 response = jstemplate_builder::GetI18nTemplateHtml( 83 response = jstemplate_builder::GetI18nTemplateHtml(
81 html, localized_strings_.get()); 84 html, localized_strings_.get());
85 } else if (path == kLoginPath) {
86 static const base::StringPiece html(
87 ResourceBundle::GetSharedInstance().GetRawDataResource(IDR_LOGIN_HTML));
88 response = jstemplate_builder::GetI18nTemplateHtml(
89 html, localized_strings_.get());
82 } else if (path == kEnterpriseEnrollmentGaiaLoginPath) { 90 } else if (path == kEnterpriseEnrollmentGaiaLoginPath) {
83 static const base::StringPiece html( 91 static const base::StringPiece html(
84 ResourceBundle::GetSharedInstance().GetRawDataResource( 92 ResourceBundle::GetSharedInstance().GetRawDataResource(
85 IDR_GAIA_LOGIN_HTML)); 93 IDR_GAIA_LOGIN_HTML));
86 response = jstemplate_builder::GetI18nTemplateHtml( 94 response = jstemplate_builder::GetI18nTemplateHtml(
87 html, localized_strings_.get()); 95 html, localized_strings_.get());
88 } 96 }
89 97
90 SendResponse(request_id, base::RefCountedString::TakeString(&response)); 98 SendResponse(request_id, base::RefCountedString::TakeString(&response));
91 } 99 }
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 229
222 void OobeUI::ShowOobeUI(bool show) { 230 void OobeUI::ShowOobeUI(bool show) {
223 core_handler_->ShowOobeUI(show); 231 core_handler_->ShowOobeUI(show);
224 } 232 }
225 233
226 void OobeUI::ShowSigninScreen() { 234 void OobeUI::ShowSigninScreen() {
227 signin_screen_handler_->Show(core_handler_->show_oobe_ui()); 235 signin_screen_handler_->Show(core_handler_->show_oobe_ui());
228 } 236 }
229 237
230 } // namespace chromeos 238 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/chromeos/login/mock_login_ui_helpers.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698