| 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/browser/extensions/stateful_external_extension_provider.h" | 5 #include "chrome/browser/extensions/stateful_external_extension_provider.h" |
| 6 | 6 |
| 7 #include "app/app_paths.h" | 7 #include "app/app_paths.h" |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 Extension::Location crx_location, | 26 Extension::Location crx_location, |
| 27 Extension::Location download_location) | 27 Extension::Location download_location) |
| 28 : crx_location_(crx_location), | 28 : crx_location_(crx_location), |
| 29 download_location_(download_location) { | 29 download_location_(download_location) { |
| 30 } | 30 } |
| 31 | 31 |
| 32 StatefulExternalExtensionProvider::~StatefulExternalExtensionProvider() { | 32 StatefulExternalExtensionProvider::~StatefulExternalExtensionProvider() { |
| 33 } | 33 } |
| 34 | 34 |
| 35 void StatefulExternalExtensionProvider::VisitRegisteredExtension( | 35 void StatefulExternalExtensionProvider::VisitRegisteredExtension( |
| 36 Visitor* visitor, const std::set<std::string>& ids_to_ignore) const { | 36 Visitor* visitor) const { |
| 37 for (DictionaryValue::key_iterator i = prefs_->begin_keys(); | 37 for (DictionaryValue::key_iterator i = prefs_->begin_keys(); |
| 38 i != prefs_->end_keys(); ++i) { | 38 i != prefs_->end_keys(); ++i) { |
| 39 const std::string& extension_id = *i; | 39 const std::string& extension_id = *i; |
| 40 if (ids_to_ignore.find(extension_id) != ids_to_ignore.end()) | |
| 41 continue; | |
| 42 | |
| 43 DictionaryValue* extension; | 40 DictionaryValue* extension; |
| 44 if (!prefs_->GetDictionaryWithoutPathExpansion(extension_id, &extension)) | 41 if (!prefs_->GetDictionaryWithoutPathExpansion(extension_id, &extension)) |
| 45 continue; | 42 continue; |
| 46 | 43 |
| 47 FilePath::StringType external_crx; | 44 FilePath::StringType external_crx; |
| 48 std::string external_version; | 45 std::string external_version; |
| 49 std::string external_update_url; | 46 std::string external_update_url; |
| 50 | 47 |
| 51 bool has_external_crx = extension->GetString(kExternalCrx, &external_crx); | 48 bool has_external_crx = extension->GetString(kExternalCrx, &external_crx); |
| 52 bool has_external_version = extension->GetString(kExternalVersion, | 49 bool has_external_version = extension->GetString(kExternalVersion, |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 } else { | 147 } else { |
| 151 NOTREACHED(); // Chrome should not allow prefs to get into this state. | 148 NOTREACHED(); // Chrome should not allow prefs to get into this state. |
| 152 return false; | 149 return false; |
| 153 } | 150 } |
| 154 | 151 |
| 155 if (location) | 152 if (location) |
| 156 *location = loc; | 153 *location = loc; |
| 157 | 154 |
| 158 return true; | 155 return true; |
| 159 } | 156 } |
| OLD | NEW |