| 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::ForExtension(extension) | 50 extension->permissions_data()->SetActivePermissions(new PermissionSet( |
| 51 ->SetActivePermissions(new PermissionSet( | 51 apis, manifest_permissions, explicit_hosts, scriptable_hosts)); |
| 52 apis, manifest_permissions, explicit_hosts, scriptable_hosts)); | |
| 53 } | 52 } |
| 54 return extension; | 53 return extension; |
| 55 } | 54 } |
| 56 | 55 |
| 57 namespace IPC { | 56 namespace IPC { |
| 58 | 57 |
| 59 template <> | 58 template <> |
| 60 struct ParamTraits<Manifest::Location> { | 59 struct ParamTraits<Manifest::Location> { |
| 61 typedef Manifest::Location param_type; | 60 typedef Manifest::Location param_type; |
| 62 static void Write(Message* m, const param_type& p) { | 61 static void Write(Message* m, const param_type& p) { |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 ReadParam(m, iter, &p->explicit_hosts) && | 239 ReadParam(m, iter, &p->explicit_hosts) && |
| 241 ReadParam(m, iter, &p->scriptable_hosts); | 240 ReadParam(m, iter, &p->scriptable_hosts); |
| 242 } | 241 } |
| 243 | 242 |
| 244 void ParamTraits<ExtensionMsg_Loaded_Params>::Log(const param_type& p, | 243 void ParamTraits<ExtensionMsg_Loaded_Params>::Log(const param_type& p, |
| 245 std::string* l) { | 244 std::string* l) { |
| 246 l->append(p.id); | 245 l->append(p.id); |
| 247 } | 246 } |
| 248 | 247 |
| 249 } // namespace IPC | 248 } // namespace IPC |
| OLD | NEW |