| 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 10 matching lines...) Expand all Loading... |
| 21 #include "chrome/browser/chromeos/login/login_utils.h" | 21 #include "chrome/browser/chromeos/login/login_utils.h" |
| 22 #include "chrome/browser/chromeos/login/user_manager.h" | 22 #include "chrome/browser/chromeos/login/user_manager.h" |
| 23 #include "chrome/browser/chromeos/login/views_login_display_host.h" | 23 #include "chrome/browser/chromeos/login/views_login_display_host.h" |
| 24 #include "chrome/browser/chromeos/login/webui_login_display_host.h" | 24 #include "chrome/browser/chromeos/login/webui_login_display_host.h" |
| 25 #include "chrome/browser/chromeos/login/wizard_controller.h" | 25 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 26 #include "chrome/browser/chromeos/system/timezone_settings.h" | 26 #include "chrome/browser/chromeos/system/timezone_settings.h" |
| 27 #include "chrome/browser/chromeos/wm_ipc.h" | 27 #include "chrome/browser/chromeos/wm_ipc.h" |
| 28 #include "chrome/browser/policy/browser_policy_connector.h" | 28 #include "chrome/browser/policy/browser_policy_connector.h" |
| 29 #include "chrome/browser/prefs/pref_service.h" | 29 #include "chrome/browser/prefs/pref_service.h" |
| 30 #include "chrome/common/pref_names.h" | 30 #include "chrome/common/pref_names.h" |
| 31 #include "content/common/content_notification_types.h" |
| 31 #include "content/common/notification_service.h" | 32 #include "content/common/notification_service.h" |
| 32 #include "content/common/notification_type.h" | |
| 33 #include "googleurl/src/gurl.h" | 33 #include "googleurl/src/gurl.h" |
| 34 #include "third_party/cros/chromeos_wm_ipc_enums.h" | 34 #include "third_party/cros/chromeos_wm_ipc_enums.h" |
| 35 #include "ui/base/resource/resource_bundle.h" | 35 #include "ui/base/resource/resource_bundle.h" |
| 36 #include "unicode/timezone.h" | 36 #include "unicode/timezone.h" |
| 37 | 37 |
| 38 // TODO(altimofeev): move to ViewsLoginDisplayHost | 38 // TODO(altimofeev): move to ViewsLoginDisplayHost |
| 39 #include "chrome/browser/chromeos/login/views_oobe_display.h" | 39 #include "chrome/browser/chromeos/login/views_oobe_display.h" |
| 40 | 40 |
| 41 | 41 |
| 42 namespace { | 42 namespace { |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 // BaseLoginDisplayHost -------------------------------------------------------- | 90 // BaseLoginDisplayHost -------------------------------------------------------- |
| 91 | 91 |
| 92 BaseLoginDisplayHost::BaseLoginDisplayHost(const gfx::Rect& background_bounds) | 92 BaseLoginDisplayHost::BaseLoginDisplayHost(const gfx::Rect& background_bounds) |
| 93 : background_bounds_(background_bounds) { | 93 : background_bounds_(background_bounds) { |
| 94 // We need to listen to APP_EXITING but not APP_TERMINATING because | 94 // We need to listen to APP_EXITING but not APP_TERMINATING because |
| 95 // APP_TERMINATING will never be fired as long as this keeps ref-count. | 95 // APP_TERMINATING will never be fired as long as this keeps ref-count. |
| 96 // APP_EXITING is safe here because there will be no browser instance that | 96 // APP_EXITING is safe here because there will be no browser instance that |
| 97 // will block the shutdown. | 97 // will block the shutdown. |
| 98 registrar_.Add( | 98 registrar_.Add( |
| 99 this, | 99 this, |
| 100 NotificationType::APP_EXITING, | 100 content::NOTIFICATION_APP_EXITING, |
| 101 NotificationService::AllSources()); | 101 NotificationService::AllSources()); |
| 102 DCHECK(default_host_ == NULL); | 102 DCHECK(default_host_ == NULL); |
| 103 default_host_ = this; | 103 default_host_ = this; |
| 104 | 104 |
| 105 // Add a reference count so the message loop won't exit when other | 105 // Add a reference count so the message loop won't exit when other |
| 106 // message loop clients (e.g. menus) do. | 106 // message loop clients (e.g. menus) do. |
| 107 g_browser_process->AddRefModule(); | 107 g_browser_process->AddRefModule(); |
| 108 } | 108 } |
| 109 | 109 |
| 110 BaseLoginDisplayHost::~BaseLoginDisplayHost() { | 110 BaseLoginDisplayHost::~BaseLoginDisplayHost() { |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 // Initiate services customization manifest fetching. | 187 // Initiate services customization manifest fetching. |
| 188 ServicesCustomizationDocument::GetInstance()->StartFetching(); | 188 ServicesCustomizationDocument::GetInstance()->StartFetching(); |
| 189 | 189 |
| 190 // Initiate device policy fetching. | 190 // Initiate device policy fetching. |
| 191 g_browser_process->browser_policy_connector()->ScheduleServiceInitialization( | 191 g_browser_process->browser_policy_connector()->ScheduleServiceInitialization( |
| 192 kPolicyServiceInitializationDelayMilliseconds); | 192 kPolicyServiceInitializationDelayMilliseconds); |
| 193 } | 193 } |
| 194 | 194 |
| 195 // BaseLoginDisplayHost -------------------------------------------------------- | 195 // BaseLoginDisplayHost -------------------------------------------------------- |
| 196 | 196 |
| 197 void BaseLoginDisplayHost::Observe(NotificationType type, | 197 void BaseLoginDisplayHost::Observe(int type, |
| 198 const NotificationSource& source, | 198 const NotificationSource& source, |
| 199 const NotificationDetails& details) { | 199 const NotificationDetails& details) { |
| 200 CHECK(type == NotificationType::APP_EXITING); | 200 CHECK(type == content::NOTIFICATION_APP_EXITING); |
| 201 | 201 |
| 202 registrar_.RemoveAll(); | 202 registrar_.RemoveAll(); |
| 203 MessageLoop::current()->DeleteSoon(FROM_HERE, this); | 203 MessageLoop::current()->DeleteSoon(FROM_HERE, this); |
| 204 MessageLoop::current()->Quit(); | 204 MessageLoop::current()->Quit(); |
| 205 } | 205 } |
| 206 | 206 |
| 207 } // namespace chromeos | 207 } // namespace chromeos |
| 208 | 208 |
| 209 // browser::ShowLoginWizard implementation ------------------------------------- | 209 // browser::ShowLoginWizard implementation ------------------------------------- |
| 210 | 210 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 if (!timezone_name.empty()) { | 324 if (!timezone_name.empty()) { |
| 325 icu::TimeZone* timezone = icu::TimeZone::createTimeZone( | 325 icu::TimeZone* timezone = icu::TimeZone::createTimeZone( |
| 326 icu::UnicodeString::fromUTF8(timezone_name)); | 326 icu::UnicodeString::fromUTF8(timezone_name)); |
| 327 CHECK(timezone) << "Timezone could not be set for " << timezone_name; | 327 CHECK(timezone) << "Timezone could not be set for " << timezone_name; |
| 328 chromeos::system::TimezoneSettings::GetInstance()->SetTimezone(*timezone); | 328 chromeos::system::TimezoneSettings::GetInstance()->SetTimezone(*timezone); |
| 329 } | 329 } |
| 330 } | 330 } |
| 331 } | 331 } |
| 332 | 332 |
| 333 } // namespace browser | 333 } // namespace browser |
| OLD | NEW |