Index: chrome/browser/chromeos/chrome_browser_main_chromeos.cc |
diff --git a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc |
index 1043798c94606fe5acc19635a9d406ded16909d4..5aa499f7e3bbcdc4c2c524b8593162cdbf04c996 100644 |
--- a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc |
+++ b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc |
@@ -1,4 +1,4 @@ |
-// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
@@ -62,6 +62,8 @@ |
#if defined(USE_AURA) |
#include "chrome/browser/chromeos/legacy_window_manager/initial_browser_window_observer.h" |
+#include "chrome/browser/chromeos/power/power_button_controller_delegate_chromeos.h" |
+#include "chrome/browser/chromeos/power/power_button_observer.h" |
#endif |
class MessageLoopObserver : public MessageLoopForUI::Observer { |
@@ -395,6 +397,14 @@ void ChromeBrowserMainPartsChromeos::PostBrowserStart() { |
chromeos::BluetoothManager::Initialize(); |
} |
+#if defined(USE_AURA) |
+ // This is dependent on the ash::Shell singleton already having been |
+ // initialized. |
+ power_button_observer_.reset(new chromeos::PowerButtonObserver); |
+ chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->AddObserver( |
+ power_button_observer_.get()); |
+#endif |
+ |
ChromeBrowserMainPartsLinux::PostBrowserStart(); |
} |