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

Side by Side Diff: chrome/browser/chromeos/chrome_browser_main_chromeos.cc

Issue 8558014: Add experimental extension APIs to notify about wakeup and screen unlock (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased to ToT Created 9 years, 1 month 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/chrome_browser_main_chromeos.h" 5 #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
11 #include "base/message_loop.h" 11 #include "base/message_loop.h"
12 #include "chrome/browser/chromeos/accessibility/system_event_observer.h"
12 #include "chrome/browser/chromeos/bluetooth/bluetooth_manager.h" 13 #include "chrome/browser/chromeos/bluetooth/bluetooth_manager.h"
13 #include "chrome/browser/chromeos/boot_times_loader.h" 14 #include "chrome/browser/chromeos/boot_times_loader.h"
14 #include "chrome/browser/chromeos/brightness_observer.h" 15 #include "chrome/browser/chromeos/brightness_observer.h"
15 #include "chrome/browser/chromeos/cros/cros_library.h" 16 #include "chrome/browser/chromeos/cros/cros_library.h"
16 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" 17 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h"
17 #include "chrome/browser/chromeos/dbus/power_manager_client.h" 18 #include "chrome/browser/chromeos/dbus/power_manager_client.h"
18 #include "chrome/browser/chromeos/dbus/session_manager_client.h" 19 #include "chrome/browser/chromeos/dbus/session_manager_client.h"
19 #include "chrome/browser/chromeos/disks/disk_mount_manager.h" 20 #include "chrome/browser/chromeos/disks/disk_mount_manager.h"
20 #include "chrome/browser/chromeos/input_method/input_method_manager.h" 21 #include "chrome/browser/chromeos/input_method/input_method_manager.h"
21 #include "chrome/browser/chromeos/input_method/xkeyboard.h" 22 #include "chrome/browser/chromeos/input_method/xkeyboard.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 : ChromeBrowserMainPartsLinux(parameters) { 87 : ChromeBrowserMainPartsLinux(parameters) {
87 } 88 }
88 89
89 ChromeBrowserMainPartsChromeos::~ChromeBrowserMainPartsChromeos() { 90 ChromeBrowserMainPartsChromeos::~ChromeBrowserMainPartsChromeos() {
90 chromeos::disks::DiskMountManager::Shutdown(); 91 chromeos::disks::DiskMountManager::Shutdown();
91 92
92 chromeos::BluetoothManager::Shutdown(); 93 chromeos::BluetoothManager::Shutdown();
93 94
94 chromeos::DBusThreadManager::Shutdown(); 95 chromeos::DBusThreadManager::Shutdown();
95 96
97 chromeos::accessibility::SystemEventObserver::Shutdown();
98
96 if (!parameters().ui_task && chromeos::CrosLibrary::Get()) 99 if (!parameters().ui_task && chromeos::CrosLibrary::Get())
97 chromeos::CrosLibrary::Shutdown(); 100 chromeos::CrosLibrary::Shutdown();
98 101
99 // To be precise, logout (browser shutdown) is not yet done, but the 102 // To be precise, logout (browser shutdown) is not yet done, but the
100 // remaining work is negligible, hence we say LogoutDone here. 103 // remaining work is negligible, hence we say LogoutDone here.
101 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", 104 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone",
102 false); 105 false);
103 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); 106 chromeos::BootTimesLoader::Get()->WriteLogoutTimes();
104 } 107 }
105 108
(...skipping 13 matching lines...) Expand all
119 // Initialize CrosLibrary only for the browser, unless running tests 122 // Initialize CrosLibrary only for the browser, unless running tests
120 // (which do their own CrosLibrary setup). 123 // (which do their own CrosLibrary setup).
121 if (!parameters().ui_task) { 124 if (!parameters().ui_task) {
122 bool use_stub = parameters().command_line.HasSwitch(switches::kStubCros); 125 bool use_stub = parameters().command_line.HasSwitch(switches::kStubCros);
123 chromeos::CrosLibrary::Initialize(use_stub); 126 chromeos::CrosLibrary::Initialize(use_stub);
124 } 127 }
125 // Replace the default NetworkChangeNotifierFactory with ChromeOS specific 128 // Replace the default NetworkChangeNotifierFactory with ChromeOS specific
126 // implementation. 129 // implementation.
127 net::NetworkChangeNotifier::SetFactory( 130 net::NetworkChangeNotifier::SetFactory(
128 new chromeos::CrosNetworkChangeNotifierFactory()); 131 new chromeos::CrosNetworkChangeNotifierFactory());
132
133 chromeos::accessibility::SystemEventObserver::Initialize();
129 } 134 }
130 135
131 void ChromeBrowserMainPartsChromeos::PreMainMessageLoopRun() { 136 void ChromeBrowserMainPartsChromeos::PreMainMessageLoopRun() {
132 // FILE thread is created in ChromeBrowserMainParts::PreMainMessageLoopRun(). 137 // FILE thread is created in ChromeBrowserMainParts::PreMainMessageLoopRun().
133 ChromeBrowserMainPartsLinux::PreMainMessageLoopRun(); 138 ChromeBrowserMainPartsLinux::PreMainMessageLoopRun();
134 // Get the statistics provider instance here to start loading statistcs 139 // Get the statistics provider instance here to start loading statistcs
135 // on the background FILE thread. 140 // on the background FILE thread.
136 chromeos::system::StatisticsProvider::GetInstance(); 141 chromeos::system::StatisticsProvider::GetInstance();
137 142
138 // Initialize the Chrome OS bluetooth subsystem. 143 // Initialize the Chrome OS bluetooth subsystem.
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 // DBusThreadManager is shut down. 215 // DBusThreadManager is shut down.
211 if (session_manager_observer_.get()) { 216 if (session_manager_observer_.get()) {
212 chromeos::DBusThreadManager::Get()->GetSessionManagerClient()-> 217 chromeos::DBusThreadManager::Get()->GetSessionManagerClient()->
213 RemoveObserver(session_manager_observer_.get()); 218 RemoveObserver(session_manager_observer_.get());
214 } 219 }
215 if (brightness_observer_.get()) { 220 if (brightness_observer_.get()) {
216 chromeos::DBusThreadManager::Get()->GetPowerManagerClient() 221 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()
217 ->RemoveObserver(brightness_observer_.get()); 222 ->RemoveObserver(brightness_observer_.get());
218 } 223 }
219 } 224 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698