Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/render_messages_params.h" | 5 #include "chrome/common/render_messages_params.h" |
| 6 | 6 |
| 7 #include "chrome/common/navigation_gesture.h" | 7 #include "chrome/common/navigation_gesture.h" |
| 8 #include "chrome/common/common_param_traits.h" | 8 #include "chrome/common/common_param_traits.h" |
| 9 #include "chrome/common/extensions/extension_constants.h" | 9 #include "chrome/common/extensions/extension_constants.h" |
| 10 #include "chrome/common/render_messages.h" | 10 #include "chrome/common/render_messages.h" |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 281 ViewMsg_ExtensionLoaded_Params::ViewMsg_ExtensionLoaded_Params( | 281 ViewMsg_ExtensionLoaded_Params::ViewMsg_ExtensionLoaded_Params( |
| 282 const ViewMsg_ExtensionLoaded_Params& other) | 282 const ViewMsg_ExtensionLoaded_Params& other) |
| 283 : manifest(other.manifest->DeepCopy()), | 283 : manifest(other.manifest->DeepCopy()), |
| 284 location(other.location), | 284 location(other.location), |
| 285 path(other.path), | 285 path(other.path), |
| 286 id(other.id) { | 286 id(other.id) { |
| 287 } | 287 } |
| 288 | 288 |
| 289 ViewMsg_ExtensionLoaded_Params::ViewMsg_ExtensionLoaded_Params( | 289 ViewMsg_ExtensionLoaded_Params::ViewMsg_ExtensionLoaded_Params( |
| 290 const Extension* extension) | 290 const Extension* extension) |
| 291 : manifest(new DictionaryValue()), | 291 : manifest(extension->manifest_value()->DeepCopy()), |
| 292 location(extension->location()), | 292 location(extension->location()), |
| 293 path(extension->path()), | 293 path(extension->path()), |
| 294 id(extension->id()) { | 294 id(extension->id()) { |
| 295 // As we need more bits of extension data in the renderer, add more keys to | |
| 296 // this list. | |
| 297 const char* kRendererExtensionKeys[] = { | |
| 298 extension_manifest_keys::kPublicKey, | |
| 299 extension_manifest_keys::kName, | |
| 300 extension_manifest_keys::kVersion, | |
| 301 extension_manifest_keys::kIcons, | |
| 302 extension_manifest_keys::kPermissions, | |
| 303 extension_manifest_keys::kApp | |
|
Aaron Boodman
2011/02/10 05:25:50
We were not copying the content_scripts key, which
| |
| 304 }; | |
| 305 | |
| 306 // Copy only the data we need. | |
| 307 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kRendererExtensionKeys); ++i) { | |
| 308 Value* temp = NULL; | |
| 309 if (extension->manifest_value()->Get(kRendererExtensionKeys[i], &temp)) | |
| 310 manifest->Set(kRendererExtensionKeys[i], temp->DeepCopy()); | |
| 311 } | |
| 312 } | 295 } |
| 313 | 296 |
| 314 scoped_refptr<Extension> | 297 scoped_refptr<Extension> |
| 315 ViewMsg_ExtensionLoaded_Params::ConvertToExtension() const { | 298 ViewMsg_ExtensionLoaded_Params::ConvertToExtension() const { |
| 316 // Extensions that are loaded unpacked won't have a key. | 299 // Extensions that are loaded unpacked won't have a key. |
| 317 const bool kRequireKey = false; | 300 const bool kRequireKey = false; |
| 318 std::string error; | 301 std::string error; |
| 319 | 302 |
| 320 scoped_refptr<Extension> extension( | 303 scoped_refptr<Extension> extension( |
| 321 Extension::Create(path, location, *manifest, kRequireKey, &error)); | 304 Extension::Create(path, location, *manifest, kRequireKey, &error)); |
| (...skipping 1321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1643 const param_type& p, | 1626 const param_type& p, |
| 1644 std::string* l) { | 1627 std::string* l) { |
| 1645 l->append("("); | 1628 l->append("("); |
| 1646 LogParam(p.notification_type, l); | 1629 LogParam(p.notification_type, l); |
| 1647 l->append(", "); | 1630 l->append(", "); |
| 1648 LogParam(p.acc_obj, l); | 1631 LogParam(p.acc_obj, l); |
| 1649 l->append(")"); | 1632 l->append(")"); |
| 1650 } | 1633 } |
| 1651 | 1634 |
| 1652 } // namespace IPC | 1635 } // namespace IPC |
| OLD | NEW |