OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/enterprise_extension_observer.h" | 5 #include "chrome/browser/chromeos/enterprise_extension_observer.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "chrome/browser/chromeos/cros/cros_library.h" | 8 #include "chrome/browser/chromeos/cros/cros_library.h" |
9 #include "chrome/browser/chromeos/cros/login_library.h" | 9 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" |
| 10 #include "chrome/browser/chromeos/dbus/session_manager_client.h" |
10 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
11 #include "chrome/common/chrome_notification_types.h" | 12 #include "chrome/common/chrome_notification_types.h" |
12 #include "content/browser/browser_thread.h" | 13 #include "content/browser/browser_thread.h" |
13 | 14 |
14 namespace chromeos { | 15 namespace chromeos { |
15 | 16 |
16 EnterpriseExtensionObserver::EnterpriseExtensionObserver(Profile* profile) | 17 EnterpriseExtensionObserver::EnterpriseExtensionObserver(Profile* profile) |
17 : profile_(profile) { | 18 : profile_(profile) { |
18 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 19 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
19 registrar_.Add(this, | 20 registrar_.Add(this, |
(...skipping 30 matching lines...) Expand all Loading... |
50 BrowserThread::PostTask( | 51 BrowserThread::PostTask( |
51 BrowserThread::UI, | 52 BrowserThread::UI, |
52 FROM_HERE, | 53 FROM_HERE, |
53 NewRunnableFunction(&EnterpriseExtensionObserver::NotifyEntd)); | 54 NewRunnableFunction(&EnterpriseExtensionObserver::NotifyEntd)); |
54 } | 55 } |
55 } | 56 } |
56 | 57 |
57 // static | 58 // static |
58 void EnterpriseExtensionObserver::NotifyEntd() { | 59 void EnterpriseExtensionObserver::NotifyEntd() { |
59 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 60 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
60 if (CrosLibrary::Get()->EnsureLoaded()) { | 61 DBusThreadManager::Get()->session_manager_client()->RestartEntd(); |
61 CrosLibrary::Get()->GetLoginLibrary()->RestartEntd(); | |
62 return; | |
63 } | |
64 } | 62 } |
65 | 63 |
66 } // namespace chromeos | 64 } // namespace chromeos |
OLD | NEW |