| OLD | NEW |
| 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" |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 BaseLoginDisplayHost::BaseLoginDisplayHost(const gfx::Rect& background_bounds) | 131 BaseLoginDisplayHost::BaseLoginDisplayHost(const gfx::Rect& background_bounds) |
| 132 : background_bounds_(background_bounds), | 132 : background_bounds_(background_bounds), |
| 133 ALLOW_THIS_IN_INITIALIZER_LIST(pointer_factory_(this)), | 133 ALLOW_THIS_IN_INITIALIZER_LIST(pointer_factory_(this)), |
| 134 shutting_down_(false), | 134 shutting_down_(false), |
| 135 oobe_progress_bar_visible_(false) { | 135 oobe_progress_bar_visible_(false) { |
| 136 // We need to listen to CLOSE_ALL_BROWSERS_REQUEST but not APP_TERMINATIN | 136 // We need to listen to CLOSE_ALL_BROWSERS_REQUEST but not APP_TERMINATIN |
| 137 // because/ APP_TERMINATING will never be fired as long as this keeps | 137 // because/ APP_TERMINATING will never be fired as long as this keeps |
| 138 // ref-count. CLOSE_ALL_BROWSERS_REQUEST is safe here because there will be no | 138 // ref-count. CLOSE_ALL_BROWSERS_REQUEST is safe here because there will be no |
| 139 // browser instance that will block the shutdown. | 139 // browser instance that will block the shutdown. |
| 140 registrar_.Add(this, | 140 registrar_.Add(this, |
| 141 content::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST, | 141 chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST, |
| 142 content::NotificationService::AllSources()); | 142 content::NotificationService::AllSources()); |
| 143 | 143 |
| 144 // NOTIFICATION_BROWSER_OPENED is issued after browser is created, but | 144 // NOTIFICATION_BROWSER_OPENED is issued after browser is created, but |
| 145 // not shown yet. Lock window has to be closed at this point so that | 145 // not shown yet. Lock window has to be closed at this point so that |
| 146 // a browser window exists and the window can acquire input focus. | 146 // a browser window exists and the window can acquire input focus. |
| 147 registrar_.Add(this, | 147 registrar_.Add(this, |
| 148 chrome::NOTIFICATION_BROWSER_OPENED, | 148 chrome::NOTIFICATION_BROWSER_OPENED, |
| 149 content::NotificationService::AllSources()); | 149 content::NotificationService::AllSources()); |
| 150 DCHECK(default_host_ == NULL); | 150 DCHECK(default_host_ == NULL); |
| 151 default_host_ = this; | 151 default_host_ = this; |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 pointer_factory_.GetWeakPtr())); | 265 pointer_factory_.GetWeakPtr())); |
| 266 } | 266 } |
| 267 | 267 |
| 268 //////////////////////////////////////////////////////////////////////////////// | 268 //////////////////////////////////////////////////////////////////////////////// |
| 269 // BaseLoginDisplayHost, content:NotificationObserver implementation: | 269 // BaseLoginDisplayHost, content:NotificationObserver implementation: |
| 270 | 270 |
| 271 void BaseLoginDisplayHost::Observe( | 271 void BaseLoginDisplayHost::Observe( |
| 272 int type, | 272 int type, |
| 273 const content::NotificationSource& source, | 273 const content::NotificationSource& source, |
| 274 const content::NotificationDetails& details) { | 274 const content::NotificationDetails& details) { |
| 275 if (type == content::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST) { | 275 if (type == chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST) { |
| 276 ShutdownDisplayHost(true); | 276 ShutdownDisplayHost(true); |
| 277 } else if (type == chrome::NOTIFICATION_BROWSER_OPENED) { | 277 } else if (type == chrome::NOTIFICATION_BROWSER_OPENED) { |
| 278 OnBrowserCreated(); | 278 OnBrowserCreated(); |
| 279 registrar_.Remove(this, | 279 registrar_.Remove(this, |
| 280 content::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST, | 280 chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST, |
| 281 content::NotificationService::AllSources()); | 281 content::NotificationService::AllSources()); |
| 282 registrar_.Remove(this, | 282 registrar_.Remove(this, |
| 283 chrome::NOTIFICATION_BROWSER_OPENED, | 283 chrome::NOTIFICATION_BROWSER_OPENED, |
| 284 content::NotificationService::AllSources()); | 284 content::NotificationService::AllSources()); |
| 285 } | 285 } |
| 286 } | 286 } |
| 287 | 287 |
| 288 void BaseLoginDisplayHost::ShutdownDisplayHost(bool post_quit_task) { | 288 void BaseLoginDisplayHost::ShutdownDisplayHost(bool post_quit_task) { |
| 289 if (shutting_down_) | 289 if (shutting_down_) |
| 290 return; | 290 return; |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 icu::TimeZone* timezone = icu::TimeZone::createTimeZone( |
| 570 icu::UnicodeString::fromUTF8(timezone_name)); | 570 icu::UnicodeString::fromUTF8(timezone_name)); |
| 571 CHECK(timezone) << "Timezone could not be set for " << timezone_name; | 571 CHECK(timezone) << "Timezone could not be set for " << timezone_name; |
| 572 chromeos::system::TimezoneSettings::GetInstance()->SetTimezone(*timezone); | 572 chromeos::system::TimezoneSettings::GetInstance()->SetTimezone(*timezone); |
| 573 } | 573 } |
| 574 } | 574 } |
| 575 | 575 |
| 576 } // namespace chromeos | 576 } // namespace chromeos |
| OLD | NEW |