Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(394)

Side by Side Diff: chrome/browser/chromeos/login/base_login_display_host.cc

Issue 8436002: [cros] Remove Views implementation for login/OOBE. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix all tests except of EnrollmentOK browser_test Created 9 years, 1 month 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/chromeos/login/base_login_display_host.h" 5 #include "chrome/browser/chromeos/login/base_login_display_host.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/threading/thread_restrictions.h" 10 #include "base/threading/thread_restrictions.h"
11 #include "chrome/browser/browser_process.h" 11 #include "chrome/browser/browser_process.h"
12 #include "chrome/browser/browser_shutdown.h" 12 #include "chrome/browser/browser_shutdown.h"
13 #include "chrome/browser/chromeos/cros/cros_library.h" 13 #include "chrome/browser/chromeos/cros/cros_library.h"
14 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" 14 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h"
15 #include "chrome/browser/chromeos/dbus/session_manager_client.h" 15 #include "chrome/browser/chromeos/dbus/session_manager_client.h"
16 #include "chrome/browser/chromeos/customization_document.h" 16 #include "chrome/browser/chromeos/customization_document.h"
17 #include "chrome/browser/chromeos/input_method/input_method_manager.h" 17 #include "chrome/browser/chromeos/input_method/input_method_manager.h"
18 #include "chrome/browser/chromeos/input_method/input_method_util.h" 18 #include "chrome/browser/chromeos/input_method/input_method_util.h"
19 #include "chrome/browser/chromeos/language_preferences.h" 19 #include "chrome/browser/chromeos/language_preferences.h"
20 #include "chrome/browser/chromeos/login/existing_user_controller.h" 20 #include "chrome/browser/chromeos/login/existing_user_controller.h"
21 #include "chrome/browser/chromeos/login/helper.h" 21 #include "chrome/browser/chromeos/login/helper.h"
22 #include "chrome/browser/chromeos/login/language_switch_menu.h" 22 #include "chrome/browser/chromeos/login/language_switch_menu.h"
23 #include "chrome/browser/chromeos/login/login_utils.h" 23 #include "chrome/browser/chromeos/login/login_utils.h"
24 #include "chrome/browser/chromeos/login/user_manager.h" 24 #include "chrome/browser/chromeos/login/user_manager.h"
25 #include "chrome/browser/chromeos/login/views_login_display_host.h"
26 #include "chrome/browser/chromeos/login/webui_login_display_host.h" 25 #include "chrome/browser/chromeos/login/webui_login_display_host.h"
27 #include "chrome/browser/chromeos/login/wizard_controller.h" 26 #include "chrome/browser/chromeos/login/wizard_controller.h"
28 #include "chrome/browser/chromeos/mobile_config.h" 27 #include "chrome/browser/chromeos/mobile_config.h"
29 #include "chrome/browser/chromeos/system/timezone_settings.h" 28 #include "chrome/browser/chromeos/system/timezone_settings.h"
30 #include "chrome/browser/policy/browser_policy_connector.h" 29 #include "chrome/browser/policy/browser_policy_connector.h"
31 #include "chrome/browser/prefs/pref_service.h" 30 #include "chrome/browser/prefs/pref_service.h"
32 #include "chrome/common/chrome_switches.h"
33 #include "chrome/common/pref_names.h" 31 #include "chrome/common/pref_names.h"
34 #include "content/public/browser/notification_service.h" 32 #include "content/public/browser/notification_service.h"
35 #include "content/public/browser/notification_types.h" 33 #include "content/public/browser/notification_types.h"
36 #include "googleurl/src/gurl.h" 34 #include "googleurl/src/gurl.h"
37 #include "third_party/cros_system_api/window_manager/chromeos_wm_ipc_enums.h" 35 #include "third_party/cros_system_api/window_manager/chromeos_wm_ipc_enums.h"
38 #include "ui/base/resource/resource_bundle.h" 36 #include "ui/base/resource/resource_bundle.h"
39 #include "unicode/timezone.h" 37 #include "unicode/timezone.h"
40 38
41 #if defined(TOOLKIT_USES_GTK) 39 #if defined(TOOLKIT_USES_GTK)
42 #include "chrome/browser/chromeos/wm_ipc.h" 40 #include "chrome/browser/chromeos/wm_ipc.h"
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 239
242 gfx::Rect screen_bounds(chromeos::CalculateScreenBounds(size)); 240 gfx::Rect screen_bounds(chromeos::CalculateScreenBounds(size));
243 241
244 // Check whether we need to execute OOBE process. 242 // Check whether we need to execute OOBE process.
245 bool oobe_complete = chromeos::WizardController::IsOobeCompleted(); 243 bool oobe_complete = chromeos::WizardController::IsOobeCompleted();
246 bool show_login_screen = 244 bool show_login_screen =
247 (first_screen_name.empty() && oobe_complete) || 245 (first_screen_name.empty() && oobe_complete) ||
248 first_screen_name == chromeos::WizardController::kLoginScreenName; 246 first_screen_name == chromeos::WizardController::kLoginScreenName;
249 247
250 chromeos::LoginDisplayHost* display_host; 248 chromeos::LoginDisplayHost* display_host;
251 #if defined(USE_AURA) 249 #if defined(USE_AURA)
altimofeev 2011/11/07 11:07:09 nit: this if-else is not needed anymore
Nikita (slow) 2011/11/07 11:27:43 Done.
252 // Under Aura we always use the WebUI. 250 // Under Aura we always use the WebUI.
253 display_host = new chromeos::WebUILoginDisplayHost(screen_bounds); 251 display_host = new chromeos::WebUILoginDisplayHost(screen_bounds);
254 #else 252 #else
255 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kWebUILogin)) { 253 display_host = new chromeos::WebUILoginDisplayHost(screen_bounds);
256 display_host = new chromeos::WebUILoginDisplayHost(screen_bounds);
257 } else {
258 display_host = new chromeos::ViewsLoginDisplayHost(screen_bounds);
259 }
260 #endif 254 #endif
261 255
262 if (show_login_screen && chromeos::CrosLibrary::Get()->EnsureLoaded()) { 256 if (show_login_screen && chromeos::CrosLibrary::Get()->EnsureLoaded()) {
263 // R11 > R12 migration fix. See http://crosbug.com/p/4898. 257 // R11 > R12 migration fix. See http://crosbug.com/p/4898.
264 // If user has manually changed locale during R11 OOBE, locale will be set. 258 // If user has manually changed locale during R11 OOBE, locale will be set.
265 // On R12 > R12|R13 etc. this fix won't get activated since 259 // On R12 > R12|R13 etc. this fix won't get activated since
266 // OOBE process has set kApplicationLocale to non-default value. 260 // OOBE process has set kApplicationLocale to non-default value.
267 PrefService* prefs = g_browser_process->local_state(); 261 PrefService* prefs = g_browser_process->local_state();
268 if (!prefs->HasPrefPath(prefs::kApplicationLocale)) { 262 if (!prefs->HasPrefPath(prefs::kApplicationLocale)) {
269 std::string locale = chromeos::WizardController::GetInitialLocale(); 263 std::string locale = chromeos::WizardController::GetInitialLocale();
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 // user has changed to during OOBE. 334 // user has changed to during OOBE.
341 if (!timezone_name.empty()) { 335 if (!timezone_name.empty()) {
342 icu::TimeZone* timezone = icu::TimeZone::createTimeZone( 336 icu::TimeZone* timezone = icu::TimeZone::createTimeZone(
343 icu::UnicodeString::fromUTF8(timezone_name)); 337 icu::UnicodeString::fromUTF8(timezone_name));
344 CHECK(timezone) << "Timezone could not be set for " << timezone_name; 338 CHECK(timezone) << "Timezone could not be set for " << timezone_name;
345 chromeos::system::TimezoneSettings::GetInstance()->SetTimezone(*timezone); 339 chromeos::system::TimezoneSettings::GetInstance()->SetTimezone(*timezone);
346 } 340 }
347 } 341 }
348 342
349 } // namespace browser 343 } // namespace browser
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698