OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/chromeos/login/wizard_controller.h" | 5 #include "chrome/browser/chromeos/login/wizard_controller.h" |
6 | 6 |
7 #include <gdk/gdk.h> | 7 #include <gdk/gdk.h> |
8 #include <signal.h> | 8 #include <signal.h> |
9 #include <sys/types.h> | 9 #include <sys/types.h> |
10 | 10 |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "app/l10n_util.h" | 14 #include "app/l10n_util.h" |
15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
16 #include "base/logging.h" // For NOTREACHED. | 16 #include "base/logging.h" // For NOTREACHED. |
17 #include "chrome/browser/chromeos/cros/cros_library.h" | 17 #include "chrome/browser/chromeos/cros/cros_library.h" |
18 #include "chrome/browser/chromeos/cros/login_library.h" | 18 #include "chrome/browser/chromeos/cros/login_library.h" |
19 #include "chrome/browser/chromeos/customization_document.h" | 19 #include "chrome/browser/chromeos/customization_document.h" |
20 #include "chrome/browser/chromeos/login/account_screen.h" | 20 #include "chrome/browser/chromeos/login/account_screen.h" |
21 #include "chrome/browser/chromeos/login/background_view.h" | 21 #include "chrome/browser/chromeos/login/background_view.h" |
22 #include "chrome/browser/chromeos/login/existing_user_controller.h" | 22 #include "chrome/browser/chromeos/login/existing_user_controller.h" |
| 23 #include "chrome/browser/chromeos/login/language_switch_model.h" |
23 #include "chrome/browser/chromeos/login/login_screen.h" | 24 #include "chrome/browser/chromeos/login/login_screen.h" |
24 #include "chrome/browser/chromeos/login/login_utils.h" | 25 #include "chrome/browser/chromeos/login/login_utils.h" |
25 #include "chrome/browser/chromeos/login/network_screen.h" | 26 #include "chrome/browser/chromeos/login/network_screen.h" |
26 #include "chrome/browser/chromeos/login/rounded_rect_painter.h" | 27 #include "chrome/browser/chromeos/login/rounded_rect_painter.h" |
27 #include "chrome/browser/chromeos/login/update_screen.h" | 28 #include "chrome/browser/chromeos/login/update_screen.h" |
28 #include "chrome/browser/chromeos/login/user_image_screen.h" | 29 #include "chrome/browser/chromeos/login/user_image_screen.h" |
29 #include "chrome/browser/chromeos/login/user_manager.h" | 30 #include "chrome/browser/chromeos/login/user_manager.h" |
30 #include "chrome/browser/chromeos/wm_ipc.h" | 31 #include "chrome/browser/chromeos/wm_ipc.h" |
31 #include "chrome/browser/profile_manager.h" | 32 #include "chrome/browser/profile_manager.h" |
32 #include "chrome/common/chrome_switches.h" | 33 #include "chrome/common/chrome_switches.h" |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 window->GetNativeView(), | 241 window->GetNativeView(), |
241 chromeos::WM_IPC_WINDOW_LOGIN_GUEST, | 242 chromeos::WM_IPC_WINDOW_LOGIN_GUEST, |
242 NULL); | 243 NULL); |
243 window->SetContentsView(contents_); | 244 window->SetContentsView(contents_); |
244 | 245 |
245 if (chromeos::UserManager::Get()->GetUsers().empty() || | 246 if (chromeos::UserManager::Get()->GetUsers().empty() || |
246 first_screen_name == kOutOfBoxScreenName) { | 247 first_screen_name == kOutOfBoxScreenName) { |
247 is_out_of_box_ = true; | 248 is_out_of_box_ = true; |
248 } | 249 } |
249 | 250 |
| 251 // Switch to initial locale if specified by customization. |
| 252 if (customization_ != NULL) { |
| 253 std::string locale = customization_->initial_locale(); |
| 254 if (!locale.empty()) { |
| 255 chromeos::LanguageSwitchModel::SwitchLanguage(locale); |
| 256 } |
| 257 } |
| 258 |
250 ShowFirstScreen(first_screen_name); | 259 ShowFirstScreen(first_screen_name); |
251 | 260 |
252 // This keeps the window from flashing at startup. | 261 // This keeps the window from flashing at startup. |
253 GdkWindow* gdk_window = window->GetNativeView()->window; | 262 GdkWindow* gdk_window = window->GetNativeView()->window; |
254 gdk_window_set_back_pixmap(gdk_window, NULL, false); | 263 gdk_window_set_back_pixmap(gdk_window, NULL, false); |
255 } | 264 } |
256 | 265 |
257 void WizardController::Show() { | 266 void WizardController::Show() { |
258 DCHECK(widget_); | 267 DCHECK(widget_); |
259 widget_->Show(); | 268 widget_->Show(); |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
585 WizardController* controller = new WizardController(); | 594 WizardController* controller = new WizardController(); |
586 controller->SetCustomization(customization.release()); | 595 controller->SetCustomization(customization.release()); |
587 controller->ShowBackground(screen_bounds); | 596 controller->ShowBackground(screen_bounds); |
588 controller->Init(first_screen_name, screen_bounds, true); | 597 controller->Init(first_screen_name, screen_bounds, true); |
589 controller->Show(); | 598 controller->Show(); |
590 if (chromeos::CrosLibrary::Get()->EnsureLoaded()) | 599 if (chromeos::CrosLibrary::Get()->EnsureLoaded()) |
591 chromeos::CrosLibrary::Get()->GetLoginLibrary()->EmitLoginPromptReady(); | 600 chromeos::CrosLibrary::Get()->GetLoginLibrary()->EmitLoginPromptReady(); |
592 } | 601 } |
593 | 602 |
594 } // namespace browser | 603 } // namespace browser |
OLD | NEW |