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

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

Issue 7327007: Moving notification types which are chrome specific to a new header file chrome_notification_type... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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 | 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"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 chrome::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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(NotificationType 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 == chrome::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
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::SystemAccess::GetInstance()->SetTimezone(*timezone); 328 chromeos::SystemAccess::GetInstance()->SetTimezone(*timezone);
329 } 329 }
330 } 330 }
331 } 331 }
332 332
333 } // namespace browser 333 } // namespace browser
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698