| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "chrome/browser/chromeos/cros/cros_library.h" | 9 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 void EnterpriseExtensionObserver::Observe( | 28 void EnterpriseExtensionObserver::Observe( |
| 29 int type, | 29 int type, |
| 30 const content::NotificationSource& source, | 30 const content::NotificationSource& source, |
| 31 const content::NotificationDetails& details) { | 31 const content::NotificationDetails& details) { |
| 32 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 32 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 33 DCHECK(type == chrome::NOTIFICATION_EXTENSION_INSTALLED); | 33 DCHECK(type == chrome::NOTIFICATION_EXTENSION_INSTALLED); |
| 34 if (content::Source<Profile>(source).ptr() != profile_) { | 34 if (content::Source<Profile>(source).ptr() != profile_) { |
| 35 return; | 35 return; |
| 36 } | 36 } |
| 37 extensions::Extension* extension = | 37 const extensions::Extension* extension = |
| 38 content::Details<extensions::Extension>(details).ptr(); | 38 content::Details<const extensions::InstalledExtensionInfo>(details)-> |
| 39 extension; |
| 39 if (extension->location() != | 40 if (extension->location() != |
| 40 extensions::Manifest::EXTERNAL_POLICY_DOWNLOAD) { | 41 extensions::Manifest::EXTERNAL_POLICY_DOWNLOAD) { |
| 41 return; | 42 return; |
| 42 } | 43 } |
| 43 BrowserThread::PostTask( | 44 BrowserThread::PostTask( |
| 44 BrowserThread::FILE, | 45 BrowserThread::FILE, |
| 45 FROM_HERE, | 46 FROM_HERE, |
| 46 base::Bind( | 47 base::Bind( |
| 47 &EnterpriseExtensionObserver::CheckExtensionAndNotifyEntd, | 48 &EnterpriseExtensionObserver::CheckExtensionAndNotifyEntd, |
| 48 extension->path())); | 49 extension->path())); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 61 } | 62 } |
| 62 } | 63 } |
| 63 | 64 |
| 64 // static | 65 // static |
| 65 void EnterpriseExtensionObserver::NotifyEntd() { | 66 void EnterpriseExtensionObserver::NotifyEntd() { |
| 66 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 67 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 67 DBusThreadManager::Get()->GetSessionManagerClient()->RestartEntd(); | 68 DBusThreadManager::Get()->GetSessionManagerClient()->RestartEntd(); |
| 68 } | 69 } |
| 69 | 70 |
| 70 } // namespace chromeos | 71 } // namespace chromeos |
| OLD | NEW |