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

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

Issue 10689175: Refactored code for timezone settings. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Added missing comment. Created 8 years, 5 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
OLDNEW
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/chromeos/login/base_login_display_host.h" 5 #include "chrome/browser/chromeos/login/base_login_display_host.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/shell_window_ids.h" 8 #include "ash/shell_window_ids.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/file_util.h" 11 #include "base/file_util.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/threading/thread_restrictions.h" 13 #include "base/threading/thread_restrictions.h"
14 #include "base/utf_string_conversions.h"
14 #include "chrome/browser/browser_process.h" 15 #include "chrome/browser/browser_process.h"
15 #include "chrome/browser/browser_shutdown.h" 16 #include "chrome/browser/browser_shutdown.h"
16 #include "chrome/browser/chromeos/cros/cros_library.h" 17 #include "chrome/browser/chromeos/cros/cros_library.h"
17 #include "chrome/browser/chromeos/customization_document.h" 18 #include "chrome/browser/chromeos/customization_document.h"
18 #include "chrome/browser/chromeos/input_method/input_method_manager.h" 19 #include "chrome/browser/chromeos/input_method/input_method_manager.h"
19 #include "chrome/browser/chromeos/input_method/input_method_util.h" 20 #include "chrome/browser/chromeos/input_method/input_method_util.h"
20 #include "chrome/browser/chromeos/language_preferences.h" 21 #include "chrome/browser/chromeos/language_preferences.h"
21 #include "chrome/browser/chromeos/login/existing_user_controller.h" 22 #include "chrome/browser/chromeos/login/existing_user_controller.h"
22 #include "chrome/browser/chromeos/login/helper.h" 23 #include "chrome/browser/chromeos/login/helper.h"
23 #include "chrome/browser/chromeos/login/language_switch_menu.h" 24 #include "chrome/browser/chromeos/login/language_switch_menu.h"
(...skipping 19 matching lines...) Expand all
43 #include "ui/aura/window.h" 44 #include "ui/aura/window.h"
44 #include "ui/base/resource/resource_bundle.h" 45 #include "ui/base/resource/resource_bundle.h"
45 #include "ui/compositor/layer.h" 46 #include "ui/compositor/layer.h"
46 #include "ui/compositor/layer_animation_element.h" 47 #include "ui/compositor/layer_animation_element.h"
47 #include "ui/compositor/layer_animation_sequence.h" 48 #include "ui/compositor/layer_animation_sequence.h"
48 #include "ui/compositor/layer_animator.h" 49 #include "ui/compositor/layer_animator.h"
49 #include "ui/compositor/scoped_layer_animation_settings.h" 50 #include "ui/compositor/scoped_layer_animation_settings.h"
50 #include "ui/gfx/rect.h" 51 #include "ui/gfx/rect.h"
51 #include "ui/gfx/transform.h" 52 #include "ui/gfx/transform.h"
52 #include "ui/views/widget/widget.h" 53 #include "ui/views/widget/widget.h"
53 #include "unicode/timezone.h"
54 54
55 namespace { 55 namespace {
56 56
57 // Whether sign in transitions are enabled. 57 // Whether sign in transitions are enabled.
58 const bool kEnableBackgroundAnimation = false; 58 const bool kEnableBackgroundAnimation = false;
59 const bool kEnableBrowserWindowsOpacityAnimation = true; 59 const bool kEnableBrowserWindowsOpacityAnimation = true;
60 const bool kEnableBrowserWindowsTransformAnimation = true; 60 const bool kEnableBrowserWindowsTransformAnimation = true;
61 61
62 // Sign in transition timings. 62 // Sign in transition timings.
63 static const int kBackgroundTransitionPauseMs = 100; 63 static const int kBackgroundTransitionPauseMs = 100;
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 chromeos::LoginUtils::Get()->PrewarmAuthentication(); 559 chromeos::LoginUtils::Get()->PrewarmAuthentication();
560 chromeos::DBusThreadManager::Get()->GetSessionManagerClient() 560 chromeos::DBusThreadManager::Get()->GetSessionManagerClient()
561 ->EmitLoginPromptReady(); 561 ->EmitLoginPromptReady();
562 562
563 // Set initial timezone if specified by customization. 563 // Set initial timezone if specified by customization.
564 const std::string timezone_name = startup_manifest->initial_timezone(); 564 const std::string timezone_name = startup_manifest->initial_timezone();
565 VLOG(1) << "Initial time zone: " << timezone_name; 565 VLOG(1) << "Initial time zone: " << timezone_name;
566 // Apply locale customizations only once to preserve whatever locale 566 // Apply locale customizations only once to preserve whatever locale
567 // user has changed to during OOBE. 567 // user has changed to during OOBE.
568 if (!timezone_name.empty()) { 568 if (!timezone_name.empty()) {
569 icu::TimeZone* timezone = icu::TimeZone::createTimeZone( 569 chromeos::system::TimezoneSettings::GetInstance()->SetTimezoneFromID(
570 icu::UnicodeString::fromUTF8(timezone_name)); 570 UTF8ToUTF16(timezone_name));
571 CHECK(timezone) << "Timezone could not be set for " << timezone_name;
572 chromeos::system::TimezoneSettings::GetInstance()->SetTimezone(*timezone);
573 } 571 }
574 } 572 }
575 573
576 } // namespace chromeos 574 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/device_settings_provider.cc ('k') | chrome/browser/chromeos/system/timezone_settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698