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/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" |
(...skipping 13 matching lines...) Expand all Loading... |
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" | 25 #include "chrome/browser/chromeos/login/views_login_display_host.h" |
26 #include "chrome/browser/chromeos/login/webui_login_display_host.h" | 26 #include "chrome/browser/chromeos/login/webui_login_display_host.h" |
27 #include "chrome/browser/chromeos/login/wizard_controller.h" | 27 #include "chrome/browser/chromeos/login/wizard_controller.h" |
28 #include "chrome/browser/chromeos/mobile_config.h" | 28 #include "chrome/browser/chromeos/mobile_config.h" |
29 #include "chrome/browser/chromeos/system/timezone_settings.h" | 29 #include "chrome/browser/chromeos/system/timezone_settings.h" |
30 #include "chrome/browser/policy/browser_policy_connector.h" | 30 #include "chrome/browser/policy/browser_policy_connector.h" |
31 #include "chrome/browser/prefs/pref_service.h" | 31 #include "chrome/browser/prefs/pref_service.h" |
32 #include "chrome/common/chrome_switches.h" | 32 #include "chrome/common/chrome_switches.h" |
33 #include "chrome/common/pref_names.h" | 33 #include "chrome/common/pref_names.h" |
34 #include "content/common/notification_service.h" | 34 #include "content/public/browser/notification_service.h" |
35 #include "content/public/browser/notification_types.h" | 35 #include "content/public/browser/notification_types.h" |
36 #include "googleurl/src/gurl.h" | 36 #include "googleurl/src/gurl.h" |
37 #include "third_party/cros_system_api/window_manager/chromeos_wm_ipc_enums.h" | 37 #include "third_party/cros_system_api/window_manager/chromeos_wm_ipc_enums.h" |
38 #include "ui/base/resource/resource_bundle.h" | 38 #include "ui/base/resource/resource_bundle.h" |
39 #include "unicode/timezone.h" | 39 #include "unicode/timezone.h" |
40 | 40 |
41 // TODO(altimofeev): move to ViewsLoginDisplayHost | 41 // TODO(altimofeev): move to ViewsLoginDisplayHost |
42 #include "chrome/browser/chromeos/login/views_oobe_display.h" | 42 #include "chrome/browser/chromeos/login/views_oobe_display.h" |
43 | 43 |
44 #if defined(TOOLKIT_USES_GTK) | 44 #if defined(TOOLKIT_USES_GTK) |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 | 99 |
100 BaseLoginDisplayHost::BaseLoginDisplayHost(const gfx::Rect& background_bounds) | 100 BaseLoginDisplayHost::BaseLoginDisplayHost(const gfx::Rect& background_bounds) |
101 : background_bounds_(background_bounds) { | 101 : background_bounds_(background_bounds) { |
102 // We need to listen to APP_EXITING but not APP_TERMINATING because | 102 // We need to listen to APP_EXITING but not APP_TERMINATING because |
103 // APP_TERMINATING will never be fired as long as this keeps ref-count. | 103 // APP_TERMINATING will never be fired as long as this keeps ref-count. |
104 // APP_EXITING is safe here because there will be no browser instance that | 104 // APP_EXITING is safe here because there will be no browser instance that |
105 // will block the shutdown. | 105 // will block the shutdown. |
106 registrar_.Add( | 106 registrar_.Add( |
107 this, | 107 this, |
108 content::NOTIFICATION_APP_EXITING, | 108 content::NOTIFICATION_APP_EXITING, |
109 NotificationService::AllSources()); | 109 content::NotificationService::AllSources()); |
110 DCHECK(default_host_ == NULL); | 110 DCHECK(default_host_ == NULL); |
111 default_host_ = this; | 111 default_host_ = this; |
112 | 112 |
113 // Add a reference count so the message loop won't exit when other | 113 // Add a reference count so the message loop won't exit when other |
114 // message loop clients (e.g. menus) do. | 114 // message loop clients (e.g. menus) do. |
115 g_browser_process->AddRefModule(); | 115 g_browser_process->AddRefModule(); |
116 } | 116 } |
117 | 117 |
118 BaseLoginDisplayHost::~BaseLoginDisplayHost() { | 118 BaseLoginDisplayHost::~BaseLoginDisplayHost() { |
119 // A browser should already exist when destructor is called since | 119 // A browser should already exist when destructor is called since |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 // user has changed to during OOBE. | 361 // user has changed to during OOBE. |
362 if (!timezone_name.empty()) { | 362 if (!timezone_name.empty()) { |
363 icu::TimeZone* timezone = icu::TimeZone::createTimeZone( | 363 icu::TimeZone* timezone = icu::TimeZone::createTimeZone( |
364 icu::UnicodeString::fromUTF8(timezone_name)); | 364 icu::UnicodeString::fromUTF8(timezone_name)); |
365 CHECK(timezone) << "Timezone could not be set for " << timezone_name; | 365 CHECK(timezone) << "Timezone could not be set for " << timezone_name; |
366 chromeos::system::TimezoneSettings::GetInstance()->SetTimezone(*timezone); | 366 chromeos::system::TimezoneSettings::GetInstance()->SetTimezone(*timezone); |
367 } | 367 } |
368 } | 368 } |
369 | 369 |
370 } // namespace browser | 370 } // namespace browser |
OLD | NEW |