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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
75 } | 75 } |
76 } | 76 } |
77 } | 77 } |
78 | 78 |
79 ExtensionMsg_Loaded_Params::ExtensionMsg_Loaded_Params( | 79 ExtensionMsg_Loaded_Params::ExtensionMsg_Loaded_Params( |
80 const ExtensionMsg_Loaded_Params& other) = default; | 80 const ExtensionMsg_Loaded_Params& other) = default; |
81 | 81 |
82 scoped_refptr<Extension> ExtensionMsg_Loaded_Params::ConvertToExtension( | 82 scoped_refptr<Extension> ExtensionMsg_Loaded_Params::ConvertToExtension( |
83 std::string* error) const { | 83 std::string* error) const { |
84 scoped_refptr<Extension> extension = | 84 scoped_refptr<Extension> extension = |
85 Extension::Create(path, location, *manifest, creation_flags, error); | 85 Extension::Create(path, location, *manifest, creation_flags, id, error); |
asargent_no_longer_on_chrome
2016/08/25 19:02:50
Doesn't the non-id-taking version of Extension::Cr
Devlin
2016/08/25 20:40:56
See CL (or bug) description. :) But this is proba
| |
86 if (extension.get()) { | 86 if (extension.get()) { |
87 const extensions::PermissionsData* permissions_data = | 87 const extensions::PermissionsData* permissions_data = |
88 extension->permissions_data(); | 88 extension->permissions_data(); |
89 permissions_data->SetPermissions(active_permissions.ToPermissionSet(), | 89 permissions_data->SetPermissions(active_permissions.ToPermissionSet(), |
90 withheld_permissions.ToPermissionSet()); | 90 withheld_permissions.ToPermissionSet()); |
91 for (const auto& pair : tab_specific_permissions) { | 91 for (const auto& pair : tab_specific_permissions) { |
92 permissions_data->UpdateTabSpecificPermissions( | 92 permissions_data->UpdateTabSpecificPermissions( |
93 pair.first, *pair.second.ToPermissionSet()); | 93 pair.first, *pair.second.ToPermissionSet()); |
94 } | 94 } |
95 } | 95 } |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
367 LogParam(p.explicit_hosts, l); | 367 LogParam(p.explicit_hosts, l); |
368 LogParam(p.scriptable_hosts, l); | 368 LogParam(p.scriptable_hosts, l); |
369 } | 369 } |
370 | 370 |
371 void ParamTraits<ExtensionMsg_Loaded_Params>::Write(base::Pickle* m, | 371 void ParamTraits<ExtensionMsg_Loaded_Params>::Write(base::Pickle* m, |
372 const param_type& p) { | 372 const param_type& p) { |
373 WriteParam(m, p.location); | 373 WriteParam(m, p.location); |
374 WriteParam(m, p.path); | 374 WriteParam(m, p.path); |
375 WriteParam(m, *(p.manifest)); | 375 WriteParam(m, *(p.manifest)); |
376 WriteParam(m, p.creation_flags); | 376 WriteParam(m, p.creation_flags); |
377 WriteParam(m, p.id); | |
377 WriteParam(m, p.active_permissions); | 378 WriteParam(m, p.active_permissions); |
378 WriteParam(m, p.withheld_permissions); | 379 WriteParam(m, p.withheld_permissions); |
380 WriteParam(m, p.tab_specific_permissions); | |
379 } | 381 } |
380 | 382 |
381 bool ParamTraits<ExtensionMsg_Loaded_Params>::Read(const base::Pickle* m, | 383 bool ParamTraits<ExtensionMsg_Loaded_Params>::Read(const base::Pickle* m, |
382 base::PickleIterator* iter, | 384 base::PickleIterator* iter, |
383 param_type* p) { | 385 param_type* p) { |
384 p->manifest.reset(new base::DictionaryValue()); | 386 p->manifest.reset(new base::DictionaryValue()); |
385 return ReadParam(m, iter, &p->location) && ReadParam(m, iter, &p->path) && | 387 return ReadParam(m, iter, &p->location) && ReadParam(m, iter, &p->path) && |
386 ReadParam(m, iter, p->manifest.get()) && | 388 ReadParam(m, iter, p->manifest.get()) && |
387 ReadParam(m, iter, &p->creation_flags) && | 389 ReadParam(m, iter, &p->creation_flags) && ReadParam(m, iter, &p->id) && |
388 ReadParam(m, iter, &p->active_permissions) && | 390 ReadParam(m, iter, &p->active_permissions) && |
389 ReadParam(m, iter, &p->withheld_permissions); | 391 ReadParam(m, iter, &p->withheld_permissions) && |
392 ReadParam(m, iter, &p->tab_specific_permissions); | |
390 } | 393 } |
391 | 394 |
392 void ParamTraits<ExtensionMsg_Loaded_Params>::Log(const param_type& p, | 395 void ParamTraits<ExtensionMsg_Loaded_Params>::Log(const param_type& p, |
393 std::string* l) { | 396 std::string* l) { |
394 l->append(p.id); | 397 l->append(p.id); |
395 } | 398 } |
396 | 399 |
397 } // namespace IPC | 400 } // namespace IPC |
OLD | NEW |