| 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/extensions/update_manifest.h" | 5 #include "chrome/common/extensions/update_manifest.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
| 10 #include "base/stl_util-inl.h" | 10 #include "base/stl_util-inl.h" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 return false; | 133 return false; |
| 134 } | 134 } |
| 135 | 135 |
| 136 // Get the updatecheck node. | 136 // Get the updatecheck node. |
| 137 std::vector<xmlNode*> updates = GetChildren(app_node, xml_namespace, | 137 std::vector<xmlNode*> updates = GetChildren(app_node, xml_namespace, |
| 138 "updatecheck"); | 138 "updatecheck"); |
| 139 if (updates.size() > 1) { | 139 if (updates.size() > 1) { |
| 140 *error_detail = "Too many updatecheck tags on app (expecting only 1)."; | 140 *error_detail = "Too many updatecheck tags on app (expecting only 1)."; |
| 141 return false; | 141 return false; |
| 142 } | 142 } |
| 143 if (updates.size() == 0) { | 143 if (updates.empty()) { |
| 144 *error_detail = "Missing updatecheck on app."; | 144 *error_detail = "Missing updatecheck on app."; |
| 145 return false; | 145 return false; |
| 146 } | 146 } |
| 147 xmlNode *updatecheck = updates[0]; | 147 xmlNode *updatecheck = updates[0]; |
| 148 | 148 |
| 149 if (GetAttribute(updatecheck, "status") == "noupdate") { | 149 if (GetAttribute(updatecheck, "status") == "noupdate") { |
| 150 return true; | 150 return true; |
| 151 } | 151 } |
| 152 | 152 |
| 153 // Find the url to the crx file. | 153 // Find the url to the crx file. |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 std::string error; | 258 std::string error; |
| 259 if (!ParseSingleAppTag(apps[i], gupdate_ns, ¤t, &error)) { | 259 if (!ParseSingleAppTag(apps[i], gupdate_ns, ¤t, &error)) { |
| 260 ParseError("%s", error.c_str()); | 260 ParseError("%s", error.c_str()); |
| 261 } else { | 261 } else { |
| 262 results_.list.push_back(current); | 262 results_.list.push_back(current); |
| 263 } | 263 } |
| 264 } | 264 } |
| 265 | 265 |
| 266 return true; | 266 return true; |
| 267 } | 267 } |
| OLD | NEW |