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

Side by Side Diff: chrome/browser/extensions/api/messaging/native_messaging_policy_handler.h

Issue 118253005: Add managed policies for Native Messaging (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_MESSAGING_NATIVE_MESSAGING_POLICY_HANDLER_ H_
6 #define CHROME_BROWSER_EXTENSIONS_API_MESSAGING_NATIVE_MESSAGING_POLICY_HANDLER_ H_
7
8 #include "base/memory/scoped_ptr.h"
9 #include "base/values.h"
10 #include "components/policy/core/browser/configuration_policy_handler.h"
11
12 namespace policy {
13 class PolicyMap;
14 class PolicyErrorMap;
15 } // namespace policy
16
17 namespace extensions {
18
19 // Implements additional checks for policies that are lists of Native Messaging
20 // Hosts.
21 class NativeMessagingHostListPolicyHandler
22 : public policy::TypeCheckingPolicyHandler {
23 public:
24 NativeMessagingHostListPolicyHandler(const char* policy_name,
25 const char* pref_path,
26 bool allow_wildcards);
27 virtual ~NativeMessagingHostListPolicyHandler();
28
29 // ConfigurationPolicyHandler methods:
30 virtual bool CheckPolicySettings(const policy::PolicyMap& policies,
31 policy::PolicyErrorMap* errors) OVERRIDE;
32 virtual void ApplyPolicySettings(const policy::PolicyMap& policies,
33 PrefValueMap* prefs) OVERRIDE;
34
35 protected:
36 const char* pref_path() const;
37
38 // Runs sanity checks on the policy value and returns it in |extension_ids|.
39 bool CheckAndGetList(const policy::PolicyMap& policies,
40 policy::PolicyErrorMap* errors,
41 scoped_ptr<base::ListValue>* extension_ids);
42
43 private:
44 const char* pref_path_;
45 bool allow_wildcards_;
46
47 DISALLOW_COPY_AND_ASSIGN(NativeMessagingHostListPolicyHandler);
48 };
49
50 } // namespace extensions
51
52 #endif // CHROME_BROWSER_EXTENSIONS_API_MESSAGING_NATIVE_MESSAGING_POLICY_HANDL ER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698