| OLD | NEW |
| 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/chromeos/login/base_login_display_host.h" | 5 #include "chrome/browser/chromeos/login/base_login_display_host.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/threading/thread_restrictions.h" | 9 #include "base/threading/thread_restrictions.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 #include "content/common/notification_service.h" | 28 #include "content/common/notification_service.h" |
| 29 #include "content/common/notification_type.h" | 29 #include "content/common/notification_type.h" |
| 30 #include "chrome/common/pref_names.h" | 30 #include "chrome/common/pref_names.h" |
| 31 #include "googleurl/src/gurl.h" | 31 #include "googleurl/src/gurl.h" |
| 32 #include "third_party/cros/chromeos_wm_ipc_enums.h" | 32 #include "third_party/cros/chromeos_wm_ipc_enums.h" |
| 33 #include "ui/base/resource/resource_bundle.h" | 33 #include "ui/base/resource/resource_bundle.h" |
| 34 #include "unicode/timezone.h" | 34 #include "unicode/timezone.h" |
| 35 | 35 |
| 36 #if defined(TOUCH_UI) | 36 #if defined(TOUCH_UI) |
| 37 #include "base/command_line.h" | 37 #include "base/command_line.h" |
| 38 #include "chrome/browser/chromeos/login/dom_login_display_host.h" | 38 #include "chrome/browser/chromeos/login/webui_login_display_host.h" |
| 39 #endif | 39 #endif |
| 40 | 40 |
| 41 namespace { | 41 namespace { |
| 42 | 42 |
| 43 // The delay of triggering initialization of the device policy subsystem | 43 // The delay of triggering initialization of the device policy subsystem |
| 44 // after the login screen is initialized. This makes sure that device policy | 44 // after the login screen is initialized. This makes sure that device policy |
| 45 // network requests are made while the system is idle waiting for user input. | 45 // network requests are made while the system is idle waiting for user input. |
| 46 const int kPolicyServiceInitializationDelayMilliseconds = 100; | 46 const int kPolicyServiceInitializationDelayMilliseconds = 100; |
| 47 | 47 |
| 48 // Determines the hardware keyboard from the given locale code | 48 // Determines the hardware keyboard from the given locale code |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 | 216 |
| 217 // Check whether we need to execute OOBE process. | 217 // Check whether we need to execute OOBE process. |
| 218 bool oobe_complete = WizardController::IsOobeCompleted(); | 218 bool oobe_complete = WizardController::IsOobeCompleted(); |
| 219 bool show_login_screen = | 219 bool show_login_screen = |
| 220 (first_screen_name.empty() && oobe_complete) || | 220 (first_screen_name.empty() && oobe_complete) || |
| 221 first_screen_name == WizardController::kLoginScreenName; | 221 first_screen_name == WizardController::kLoginScreenName; |
| 222 | 222 |
| 223 // TODO(nkostylev) Create LoginDisplayHost instance based on flag. | 223 // TODO(nkostylev) Create LoginDisplayHost instance based on flag. |
| 224 #if defined(TOUCH_UI) | 224 #if defined(TOUCH_UI) |
| 225 chromeos::LoginDisplayHost* display_host; | 225 chromeos::LoginDisplayHost* display_host; |
| 226 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDOMLogin)) { | 226 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kWebUILogin)) { |
| 227 display_host = new chromeos::DOMLoginDisplayHost(screen_bounds); | 227 display_host = new chromeos::WebUILoginDisplayHost(screen_bounds); |
| 228 } else { | 228 } else { |
| 229 display_host = new chromeos::ViewsLoginDisplayHost(screen_bounds); | 229 display_host = new chromeos::ViewsLoginDisplayHost(screen_bounds); |
| 230 } | 230 } |
| 231 #else | 231 #else |
| 232 chromeos::LoginDisplayHost* display_host = | 232 chromeos::LoginDisplayHost* display_host = |
| 233 new chromeos::ViewsLoginDisplayHost(screen_bounds); | 233 new chromeos::ViewsLoginDisplayHost(screen_bounds); |
| 234 #endif | 234 #endif |
| 235 if (show_login_screen && chromeos::CrosLibrary::Get()->EnsureLoaded()) { | 235 if (show_login_screen && chromeos::CrosLibrary::Get()->EnsureLoaded()) { |
| 236 display_host->StartSignInScreen(); | 236 display_host->StartSignInScreen(); |
| 237 return; | 237 return; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 if (!timezone_name.empty()) { | 300 if (!timezone_name.empty()) { |
| 301 icu::TimeZone* timezone = icu::TimeZone::createTimeZone( | 301 icu::TimeZone* timezone = icu::TimeZone::createTimeZone( |
| 302 icu::UnicodeString::fromUTF8(timezone_name)); | 302 icu::UnicodeString::fromUTF8(timezone_name)); |
| 303 CHECK(timezone) << "Timezone could not be set for " << timezone_name; | 303 CHECK(timezone) << "Timezone could not be set for " << timezone_name; |
| 304 chromeos::SystemAccess::GetInstance()->SetTimezone(*timezone); | 304 chromeos::SystemAccess::GetInstance()->SetTimezone(*timezone); |
| 305 } | 305 } |
| 306 } | 306 } |
| 307 } | 307 } |
| 308 | 308 |
| 309 } // namespace browser | 309 } // namespace browser |
| OLD | NEW |