| 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 std::string* error, | 129 std::string* error, |
| 130 std::vector<InstallWarning>* warnings) const { | 130 std::vector<InstallWarning>* warnings) const { |
| 131 // Validate claimed plugin paths. | 131 // Validate claimed plugin paths. |
| 132 if (extensions::PluginInfo::HasPlugins(extension)) { | 132 if (extensions::PluginInfo::HasPlugins(extension)) { |
| 133 const extensions::PluginInfo::PluginVector* plugins = | 133 const extensions::PluginInfo::PluginVector* plugins = |
| 134 extensions::PluginInfo::GetPlugins(extension); | 134 extensions::PluginInfo::GetPlugins(extension); |
| 135 CHECK(plugins); | 135 CHECK(plugins); |
| 136 for (std::vector<extensions::PluginInfo>::const_iterator plugin = | 136 for (std::vector<extensions::PluginInfo>::const_iterator plugin = |
| 137 plugins->begin(); | 137 plugins->begin(); |
| 138 plugin != plugins->end(); ++plugin) { | 138 plugin != plugins->end(); ++plugin) { |
| 139 if (!file_util::PathExists(plugin->path)) { | 139 if (!base::PathExists(plugin->path)) { |
| 140 *error = l10n_util::GetStringFUTF8( | 140 *error = l10n_util::GetStringFUTF8( |
| 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 |