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

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

Issue 14238037: Made it possible to tell whether an extension is being installed or updated. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Added extra check. Created 7 years, 7 months 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
« no previous file with comments | « apps/shortcut_manager.cc ('k') | chrome/browser/chromeos/screensaver/screensaver_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « apps/shortcut_manager.cc ('k') | chrome/browser/chromeos/screensaver/screensaver_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698