| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/api/plugins/plugins_handler.h" | 5 #include "chrome/common/extensions/api/plugins/plugins_handler.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 PluginsHandler::PluginsHandler() { | 59 PluginsHandler::PluginsHandler() { |
| 60 } | 60 } |
| 61 | 61 |
| 62 PluginsHandler::~PluginsHandler() { | 62 PluginsHandler::~PluginsHandler() { |
| 63 } | 63 } |
| 64 | 64 |
| 65 const std::vector<std::string> PluginsHandler::Keys() const { | 65 const std::vector<std::string> PluginsHandler::Keys() const { |
| 66 return SingleKey(keys::kPlugins); | 66 return SingleKey(keys::kPlugins); |
| 67 } | 67 } |
| 68 | 68 |
| 69 bool PluginsHandler::Parse(Extension* extension, string16* error) { | 69 bool PluginsHandler::Parse(Extension* extension, base::string16* error) { |
| 70 const base::ListValue* list_value = NULL; | 70 const base::ListValue* list_value = NULL; |
| 71 if (!extension->manifest()->GetList(keys::kPlugins, &list_value)) { | 71 if (!extension->manifest()->GetList(keys::kPlugins, &list_value)) { |
| 72 *error = ASCIIToUTF16(manifest_errors::kInvalidPlugins); | 72 *error = ASCIIToUTF16(manifest_errors::kInvalidPlugins); |
| 73 return false; | 73 return false; |
| 74 } | 74 } |
| 75 | 75 |
| 76 scoped_ptr<PluginManifestData> plugins_data(new PluginManifestData); | 76 scoped_ptr<PluginManifestData> plugins_data(new PluginManifestData); |
| 77 | 77 |
| 78 for (size_t i = 0; i < list_value->GetSize(); ++i) { | 78 for (size_t i = 0; i < list_value->GetSize(); ++i) { |
| 79 const base::DictionaryValue* plugin_value = NULL; | 79 const base::DictionaryValue* plugin_value = NULL; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 IDS_EXTENSION_LOAD_PLUGIN_PATH_FAILED, | 141 IDS_EXTENSION_LOAD_PLUGIN_PATH_FAILED, |
| 142 plugin->path.LossyDisplayName()); | 142 plugin->path.LossyDisplayName()); |
| 143 return false; | 143 return false; |
| 144 } | 144 } |
| 145 } | 145 } |
| 146 } | 146 } |
| 147 return true; | 147 return true; |
| 148 } | 148 } |
| 149 | 149 |
| 150 } // namespace extensions | 150 } // namespace extensions |
| OLD | NEW |