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

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

Issue 8342048: Make NotificationService an interface in the content namespace, and switch callers to use it. Mov... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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 13 matching lines...) Expand all
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/locale_change_guard.cc ('k') | chrome/browser/chromeos/login/existing_user_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698