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

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: 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 (extension->location() != extensions::Manifest::EXTERNAL_POLICY &&
40 extensions::Manifest::EXTERNAL_POLICY_DOWNLOAD) { 40 extension->location() != extensions::Manifest::EXTERNAL_POLICY_DOWNLOAD) {
41 return; 41 return;
42 } 42 }
43 BrowserThread::PostTask( 43 BrowserThread::PostTask(
44 BrowserThread::FILE, 44 BrowserThread::FILE,
45 FROM_HERE, 45 FROM_HERE,
46 base::Bind( 46 base::Bind(
47 &EnterpriseExtensionObserver::CheckExtensionAndNotifyEntd, 47 &EnterpriseExtensionObserver::CheckExtensionAndNotifyEntd,
48 extension->path())); 48 extension->path()));
49 } 49 }
50 50
51 // static 51 // static
52 void EnterpriseExtensionObserver::CheckExtensionAndNotifyEntd( 52 void EnterpriseExtensionObserver::CheckExtensionAndNotifyEntd(
53 const base::FilePath& path) { 53 const base::FilePath& path) {
54 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 54 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
55 if (base::PathExists( 55 if (base::PathExists(
56 path.Append(FILE_PATH_LITERAL("isa-cros-policy")))) { 56 path.Append(FILE_PATH_LITERAL("isa-cros-policy")))) {
57 BrowserThread::PostTask( 57 BrowserThread::PostTask(
58 BrowserThread::UI, 58 BrowserThread::UI,
59 FROM_HERE, 59 FROM_HERE,
60 base::Bind(&EnterpriseExtensionObserver::NotifyEntd)); 60 base::Bind(&EnterpriseExtensionObserver::NotifyEntd));
61 } 61 }
62 } 62 }
63 63
64 void EnterpriseExtensionObserver::NotifyEntd() { 64 void EnterpriseExtensionObserver::NotifyEntd() {
65 NOTREACHED(); 65 NOTREACHED();
66 } 66 }
67 67
68 } // namespace chromeos 68 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698