OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/common/extension_messages.h" | 5 #include "extensions/common/extension_messages.h" |
6 | 6 |
7 #include "content/public/common/common_param_traits.h" | 7 #include "content/public/common/common_param_traits.h" |
8 #include "extensions/common/extension.h" | 8 #include "extensions/common/extension.h" |
9 #include "extensions/common/manifest.h" | 9 #include "extensions/common/manifest.h" |
10 #include "extensions/common/manifest_handler.h" | 10 #include "extensions/common/manifest_handler.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 scriptable_hosts(extension->GetActivePermissions()->scriptable_hosts()), | 40 scriptable_hosts(extension->GetActivePermissions()->scriptable_hosts()), |
41 id(extension->id()), | 41 id(extension->id()), |
42 creation_flags(extension->creation_flags()) { | 42 creation_flags(extension->creation_flags()) { |
43 } | 43 } |
44 | 44 |
45 scoped_refptr<Extension> ExtensionMsg_Loaded_Params::ConvertToExtension( | 45 scoped_refptr<Extension> ExtensionMsg_Loaded_Params::ConvertToExtension( |
46 std::string* error) const { | 46 std::string* error) const { |
47 scoped_refptr<Extension> extension = | 47 scoped_refptr<Extension> extension = |
48 Extension::Create(path, location, *manifest, creation_flags, error); | 48 Extension::Create(path, location, *manifest, creation_flags, error); |
49 if (extension.get()) { | 49 if (extension.get()) { |
50 extensions::PermissionsData::SetActivePermissions( | 50 extensions::PermissionsData::ForExtension(extension) |
51 extension.get(), | 51 ->SetActivePermissions(new PermissionSet( |
52 new PermissionSet(apis, manifest_permissions, | 52 apis, manifest_permissions, explicit_hosts, scriptable_hosts)); |
53 explicit_hosts, scriptable_hosts)); | |
54 } | 53 } |
55 return extension; | 54 return extension; |
56 } | 55 } |
57 | 56 |
58 namespace IPC { | 57 namespace IPC { |
59 | 58 |
60 template <> | 59 template <> |
61 struct ParamTraits<Manifest::Location> { | 60 struct ParamTraits<Manifest::Location> { |
62 typedef Manifest::Location param_type; | 61 typedef Manifest::Location param_type; |
63 static void Write(Message* m, const param_type& p) { | 62 static void Write(Message* m, const param_type& p) { |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 ReadParam(m, iter, &p->explicit_hosts) && | 240 ReadParam(m, iter, &p->explicit_hosts) && |
242 ReadParam(m, iter, &p->scriptable_hosts); | 241 ReadParam(m, iter, &p->scriptable_hosts); |
243 } | 242 } |
244 | 243 |
245 void ParamTraits<ExtensionMsg_Loaded_Params>::Log(const param_type& p, | 244 void ParamTraits<ExtensionMsg_Loaded_Params>::Log(const param_type& p, |
246 std::string* l) { | 245 std::string* l) { |
247 l->append(p.id); | 246 l->append(p.id); |
248 } | 247 } |
249 | 248 |
250 } // namespace IPC | 249 } // namespace IPC |
OLD | NEW |