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

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

Issue 24365004: Add EXTERNAL_POLICY to list of possible extension locations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments addressed. Created 7 years, 2 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 | Annotate | Revision Log
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/chrome_notification_types.h" 9 #include "chrome/browser/chrome_notification_types.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 18 matching lines...) Expand all
29 const content::NotificationSource& source, 29 const content::NotificationSource& source,
30 const content::NotificationDetails& details) { 30 const content::NotificationDetails& details) {
31 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 31 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
32 DCHECK(type == chrome::NOTIFICATION_EXTENSION_INSTALLED); 32 DCHECK(type == chrome::NOTIFICATION_EXTENSION_INSTALLED);
33 if (content::Source<Profile>(source).ptr() != profile_) { 33 if (content::Source<Profile>(source).ptr() != profile_) {
34 return; 34 return;
35 } 35 }
36 const extensions::Extension* extension = 36 const extensions::Extension* extension =
37 content::Details<const extensions::InstalledExtensionInfo>(details)-> 37 content::Details<const extensions::InstalledExtensionInfo>(details)->
38 extension; 38 extension;
39 if (extension->location() != 39 if (!extensions::Manifest::IsPolicyLocation(extension->location()))
40 extensions::Manifest::EXTERNAL_POLICY_DOWNLOAD) {
41 return; 40 return;
42 }
43 BrowserThread::PostTask( 41 BrowserThread::PostTask(
44 BrowserThread::FILE, 42 BrowserThread::FILE,
45 FROM_HERE, 43 FROM_HERE,
46 base::Bind( 44 base::Bind(
47 &EnterpriseExtensionObserver::CheckExtensionAndNotifyEntd, 45 &EnterpriseExtensionObserver::CheckExtensionAndNotifyEntd,
48 extension->path())); 46 extension->path()));
49 } 47 }
50 48
51 // static 49 // static
52 void EnterpriseExtensionObserver::CheckExtensionAndNotifyEntd( 50 void EnterpriseExtensionObserver::CheckExtensionAndNotifyEntd(
53 const base::FilePath& path) { 51 const base::FilePath& path) {
54 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 52 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
55 if (base::PathExists( 53 if (base::PathExists(
56 path.Append(FILE_PATH_LITERAL("isa-cros-policy")))) { 54 path.Append(FILE_PATH_LITERAL("isa-cros-policy")))) {
57 BrowserThread::PostTask( 55 BrowserThread::PostTask(
58 BrowserThread::UI, 56 BrowserThread::UI,
59 FROM_HERE, 57 FROM_HERE,
60 base::Bind(&EnterpriseExtensionObserver::NotifyEntd)); 58 base::Bind(&EnterpriseExtensionObserver::NotifyEntd));
61 } 59 }
62 } 60 }
63 61
64 void EnterpriseExtensionObserver::NotifyEntd() { 62 void EnterpriseExtensionObserver::NotifyEntd() {
65 NOTREACHED(); 63 NOTREACHED();
66 } 64 }
67 65
68 } // namespace chromeos 66 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/background/background_contents_service.cc ('k') | chrome/browser/extensions/admin_policy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698