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

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

Issue 2839373003: struct UnloadedExtensionInfo -> enum UnloadedExtensionInfoReason (Closed)
Patch Set: Rebase Created 3 years, 7 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
« no previous file with comments | « extensions/browser/info_map.h ('k') | extensions/browser/info_map_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/info_map.h" 5 #include "extensions/browser/info_map.h"
6 6
7 #include "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
8 #include "content/public/browser/browser_thread.h" 8 #include "content/public/browser/browser_thread.h"
9 #include "extensions/browser/content_verifier.h" 9 #include "extensions/browser/content_verifier.h"
10 #include "extensions/common/constants.h" 10 #include "extensions/common/constants.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 CheckOnValidThread(); 66 CheckOnValidThread();
67 extensions_.Insert(extension); 67 extensions_.Insert(extension);
68 disabled_extensions_.Remove(extension->id()); 68 disabled_extensions_.Remove(extension->id());
69 69
70 extra_data_[extension->id()].install_time = install_time; 70 extra_data_[extension->id()].install_time = install_time;
71 extra_data_[extension->id()].incognito_enabled = incognito_enabled; 71 extra_data_[extension->id()].incognito_enabled = incognito_enabled;
72 extra_data_[extension->id()].notifications_disabled = notifications_disabled; 72 extra_data_[extension->id()].notifications_disabled = notifications_disabled;
73 } 73 }
74 74
75 void InfoMap::RemoveExtension(const std::string& extension_id, 75 void InfoMap::RemoveExtension(const std::string& extension_id,
76 const UnloadedExtensionInfo::Reason reason) { 76 const UnloadedExtensionReason reason) {
77 CheckOnValidThread(); 77 CheckOnValidThread();
78 const Extension* extension = extensions_.GetByID(extension_id); 78 const Extension* extension = extensions_.GetByID(extension_id);
79 extra_data_.erase(extension_id); // we don't care about disabled extra data 79 extra_data_.erase(extension_id); // we don't care about disabled extra data
80 bool was_uninstalled = (reason != UnloadedExtensionInfo::REASON_DISABLE && 80 bool was_uninstalled = (reason != UnloadedExtensionReason::DISABLE &&
81 reason != UnloadedExtensionInfo::REASON_TERMINATE); 81 reason != UnloadedExtensionReason::TERMINATE);
82 if (extension) { 82 if (extension) {
83 if (!was_uninstalled) 83 if (!was_uninstalled)
84 disabled_extensions_.Insert(extension); 84 disabled_extensions_.Insert(extension);
85 extensions_.Remove(extension_id); 85 extensions_.Remove(extension_id);
86 } else if (was_uninstalled) { 86 } else if (was_uninstalled) {
87 // If the extension was uninstalled, make sure it's removed from the map of 87 // If the extension was uninstalled, make sure it's removed from the map of
88 // disabled extensions. 88 // disabled extensions.
89 disabled_extensions_.Remove(extension_id); 89 disabled_extensions_.Remove(extension_id);
90 } else { 90 } else {
91 // NOTE: This can currently happen if we receive multiple unload 91 // NOTE: This can currently happen if we receive multiple unload
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 } 225 }
226 226
227 InfoMap::~InfoMap() { 227 InfoMap::~InfoMap() {
228 if (quota_service_) { 228 if (quota_service_) {
229 BrowserThread::DeleteSoon( 229 BrowserThread::DeleteSoon(
230 BrowserThread::IO, FROM_HERE, quota_service_.release()); 230 BrowserThread::IO, FROM_HERE, quota_service_.release());
231 } 231 }
232 } 232 }
233 233
234 } // namespace extensions 234 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/info_map.h ('k') | extensions/browser/info_map_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698