OLD | NEW |
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/common/extensions/extension_messages.h" | 5 #include "chrome/common/extensions/extension_messages.h" |
6 | 6 |
7 #include "chrome/common/extensions/extension.h" | 7 #include "chrome/common/extensions/extension.h" |
8 #include "chrome/common/extensions/extension_constants.h" | 8 #include "chrome/common/extensions/extension_constants.h" |
9 #include "chrome/common/extensions/manifest.h" | 9 #include "chrome/common/extensions/manifest.h" |
10 #include "chrome/common/extensions/permissions/permissions_data.h" | 10 #include "chrome/common/extensions/permissions/permissions_data.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 explicit_hosts(extension->GetActivePermissions()->explicit_hosts()), | 35 explicit_hosts(extension->GetActivePermissions()->explicit_hosts()), |
36 scriptable_hosts(extension->GetActivePermissions()->scriptable_hosts()), | 36 scriptable_hosts(extension->GetActivePermissions()->scriptable_hosts()), |
37 id(extension->id()), | 37 id(extension->id()), |
38 creation_flags(extension->creation_flags()) { | 38 creation_flags(extension->creation_flags()) { |
39 } | 39 } |
40 | 40 |
41 scoped_refptr<Extension> ExtensionMsg_Loaded_Params::ConvertToExtension( | 41 scoped_refptr<Extension> ExtensionMsg_Loaded_Params::ConvertToExtension( |
42 std::string* error) const { | 42 std::string* error) const { |
43 scoped_refptr<Extension> extension = | 43 scoped_refptr<Extension> extension = |
44 Extension::Create(path, location, *manifest, creation_flags, error); | 44 Extension::Create(path, location, *manifest, creation_flags, error); |
45 if (extension) { | 45 if (extension.get()) { |
46 extensions::PermissionsData::SetActivePermissions( | 46 extensions::PermissionsData::SetActivePermissions( |
47 extension, | 47 extension.get(), |
48 new PermissionSet(apis, explicit_hosts, scriptable_hosts)); | 48 new PermissionSet(apis, explicit_hosts, scriptable_hosts)); |
49 } | 49 } |
50 return extension; | 50 return extension; |
51 } | 51 } |
52 | 52 |
53 namespace IPC { | 53 namespace IPC { |
54 | 54 |
55 template <> | 55 template <> |
56 struct ParamTraits<Manifest::Location> { | 56 struct ParamTraits<Manifest::Location> { |
57 typedef Manifest::Location param_type; | 57 typedef Manifest::Location param_type; |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 ReadParam(m, iter, &p->explicit_hosts) && | 206 ReadParam(m, iter, &p->explicit_hosts) && |
207 ReadParam(m, iter, &p->scriptable_hosts); | 207 ReadParam(m, iter, &p->scriptable_hosts); |
208 } | 208 } |
209 | 209 |
210 void ParamTraits<ExtensionMsg_Loaded_Params>::Log(const param_type& p, | 210 void ParamTraits<ExtensionMsg_Loaded_Params>::Log(const param_type& p, |
211 std::string* l) { | 211 std::string* l) { |
212 l->append(p.id); | 212 l->append(p.id); |
213 } | 213 } |
214 | 214 |
215 } // namespace IPC | 215 } // namespace IPC |
OLD | NEW |