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/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" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 const MainFunctionParams& parameters) | 74 const MainFunctionParams& parameters) |
75 : ChromeBrowserMainPartsLinux(parameters) { | 75 : ChromeBrowserMainPartsLinux(parameters) { |
76 } | 76 } |
77 | 77 |
78 ChromeBrowserMainPartsChromeos::~ChromeBrowserMainPartsChromeos() { | 78 ChromeBrowserMainPartsChromeos::~ChromeBrowserMainPartsChromeos() { |
79 chromeos::BluetoothManager::Shutdown(); | 79 chromeos::BluetoothManager::Shutdown(); |
80 | 80 |
81 // We should remove observers attached to D-Bus clients before | 81 // We should remove observers attached to D-Bus clients before |
82 // DBusThreadManager is shut down. | 82 // DBusThreadManager is shut down. |
83 if (session_manager_observer_.get()) { | 83 if (session_manager_observer_.get()) { |
84 chromeos::DBusThreadManager::Get()->session_manager_client()-> | 84 chromeos::DBusThreadManager::Get()->GetSessionManagerClient()-> |
85 RemoveObserver(session_manager_observer_.get()); | 85 RemoveObserver(session_manager_observer_.get()); |
86 } | 86 } |
87 if (brightness_observer_.get()) { | 87 if (brightness_observer_.get()) { |
88 chromeos::DBusThreadManager::Get()->power_manager_client()->RemoveObserver( | 88 chromeos::DBusThreadManager::Get()->GetPowerManagerClient() |
89 brightness_observer_.get()); | 89 ->RemoveObserver(brightness_observer_.get()); |
90 } | 90 } |
91 | 91 |
92 chromeos::DBusThreadManager::Shutdown(); | 92 chromeos::DBusThreadManager::Shutdown(); |
93 | 93 |
94 if (!parameters().ui_task && chromeos::CrosLibrary::Get()) | 94 if (!parameters().ui_task && chromeos::CrosLibrary::Get()) |
95 chromeos::CrosLibrary::Shutdown(); | 95 chromeos::CrosLibrary::Shutdown(); |
96 | 96 |
97 // To be precise, logout (browser shutdown) is not yet done, but the | 97 // To be precise, logout (browser shutdown) is not yet done, but the |
98 // remaining work is negligible, hence we say LogoutDone here. | 98 // remaining work is negligible, hence we say LogoutDone here. |
99 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", | 99 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 MessageLoopForUI* message_loop = MessageLoopForUI::current(); | 139 MessageLoopForUI* message_loop = MessageLoopForUI::current(); |
140 message_loop->AddObserver(g_message_loop_observer.Pointer()); | 140 message_loop->AddObserver(g_message_loop_observer.Pointer()); |
141 | 141 |
142 // Initialize DBusThreadManager for the browser. This must be done after | 142 // Initialize DBusThreadManager for the browser. This must be done after |
143 // the main message loop is started, as it uses the message loop. | 143 // the main message loop is started, as it uses the message loop. |
144 chromeos::DBusThreadManager::Initialize(); | 144 chromeos::DBusThreadManager::Initialize(); |
145 | 145 |
146 // Initialize the brightness observer so that we'll display an onscreen | 146 // Initialize the brightness observer so that we'll display an onscreen |
147 // indication of brightness changes during login. | 147 // indication of brightness changes during login. |
148 brightness_observer_.reset(new chromeos::BrightnessObserver()); | 148 brightness_observer_.reset(new chromeos::BrightnessObserver()); |
149 chromeos::DBusThreadManager::Get()->power_manager_client()->AddObserver( | 149 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->AddObserver( |
150 brightness_observer_.get()); | 150 brightness_observer_.get()); |
151 // Initialize the session manager observer so that we'll take actions | 151 // Initialize the session manager observer so that we'll take actions |
152 // per signals sent from the session manager. | 152 // per signals sent from the session manager. |
153 session_manager_observer_.reset(new chromeos::SessionManagerObserver); | 153 session_manager_observer_.reset(new chromeos::SessionManagerObserver); |
154 chromeos::DBusThreadManager::Get()->session_manager_client()-> | 154 chromeos::DBusThreadManager::Get()->GetSessionManagerClient()-> |
155 AddObserver(session_manager_observer_.get()); | 155 AddObserver(session_manager_observer_.get()); |
156 | 156 |
157 // Initialize the Chrome OS bluetooth subsystem | 157 // Initialize the Chrome OS bluetooth subsystem |
158 if (parsed_command_line().HasSwitch(switches::kEnableBluetooth)) { | 158 if (parsed_command_line().HasSwitch(switches::kEnableBluetooth)) { |
159 chromeos::BluetoothManager::Initialize(); | 159 chromeos::BluetoothManager::Initialize(); |
160 } | 160 } |
161 } | 161 } |
OLD | NEW |