Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Side by Side Diff: extensions/browser/extension_registry.cc

Issue 2908513002: Include terminated extensions while retrieving extension version. (Closed)
Patch Set: fix browsertest Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 "extensions/browser/extension_registry.h" 5 #include "extensions/browser/extension_registry.h"
6 6
7 #include "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
8 #include "extensions/browser/extension_registry_factory.h" 8 #include "extensions/browser/extension_registry_factory.h"
9 #include "extensions/browser/extension_registry_observer.h" 9 #include "extensions/browser/extension_registry_observer.h"
10 10
(...skipping 23 matching lines...) Expand all
34 if (include_mask & IncludeFlag::TERMINATED) 34 if (include_mask & IncludeFlag::TERMINATED)
35 installed_extensions->InsertAll(terminated_extensions_); 35 installed_extensions->InsertAll(terminated_extensions_);
36 if (include_mask & IncludeFlag::BLACKLISTED) 36 if (include_mask & IncludeFlag::BLACKLISTED)
37 installed_extensions->InsertAll(blacklisted_extensions_); 37 installed_extensions->InsertAll(blacklisted_extensions_);
38 if (include_mask & IncludeFlag::BLOCKED) 38 if (include_mask & IncludeFlag::BLOCKED)
39 installed_extensions->InsertAll(blocked_extensions_); 39 installed_extensions->InsertAll(blocked_extensions_);
40 return installed_extensions; 40 return installed_extensions;
41 } 41 }
42 42
43 base::Version ExtensionRegistry::GetStoredVersion(const ExtensionId& id) const { 43 base::Version ExtensionRegistry::GetStoredVersion(const ExtensionId& id) const {
44 // TODO(lazyboy): Why not TERMINATED? https://crbug.com/724563.
45 int include_mask = ExtensionRegistry::ENABLED | ExtensionRegistry::DISABLED | 44 int include_mask = ExtensionRegistry::ENABLED | ExtensionRegistry::DISABLED |
45 ExtensionRegistry::TERMINATED |
46 ExtensionRegistry::BLACKLISTED | 46 ExtensionRegistry::BLACKLISTED |
47 ExtensionRegistry::BLOCKED; 47 ExtensionRegistry::BLOCKED;
48 const Extension* registry_extension = GetExtensionById(id, include_mask); 48 const Extension* registry_extension = GetExtensionById(id, include_mask);
49 return registry_extension ? *registry_extension->version() : base::Version(); 49 return registry_extension ? *registry_extension->version() : base::Version();
50 } 50 }
51 51
52 void ExtensionRegistry::AddObserver(ExtensionRegistryObserver* observer) { 52 void ExtensionRegistry::AddObserver(ExtensionRegistryObserver* observer) {
53 observers_.AddObserver(observer); 53 observers_.AddObserver(observer);
54 } 54 }
55 55
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 } 211 }
212 212
213 void ExtensionRegistry::Shutdown() { 213 void ExtensionRegistry::Shutdown() {
214 // Release references to all Extension objects in the sets. 214 // Release references to all Extension objects in the sets.
215 ClearAll(); 215 ClearAll();
216 for (auto& observer : observers_) 216 for (auto& observer : observers_)
217 observer.OnShutdown(this); 217 observer.OnShutdown(this);
218 } 218 }
219 219
220 } // namespace extensions 220 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/runtime/runtime_apitest.cc ('k') | extensions/browser/extension_registry_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698