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

Side by Side Diff: chrome/browser/extensions/extension_service.cc

Issue 14246028: Clear the background_page_ready flag in DisableExtension. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 8 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/browser/extensions/extension_service.h" 5 #include "chrome/browser/extensions/extension_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 #include <set> 9 #include <set>
10 10
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after
959 } 959 }
960 960
961 extension_prefs_->SetExtensionState(extension_id, Extension::DISABLED); 961 extension_prefs_->SetExtensionState(extension_id, Extension::DISABLED);
962 extension_prefs_->AddDisableReason(extension_id, disable_reason); 962 extension_prefs_->AddDisableReason(extension_id, disable_reason);
963 963
964 int include_mask = INCLUDE_EVERYTHING & ~INCLUDE_DISABLED; 964 int include_mask = INCLUDE_EVERYTHING & ~INCLUDE_DISABLED;
965 extension = GetExtensionById(extension_id, include_mask); 965 extension = GetExtensionById(extension_id, include_mask);
966 if (!extension) 966 if (!extension)
967 return; 967 return;
968 968
969 // Reset the background_page_ready flag
970 if (extensions::BackgroundInfo::HasBackgroundPage(extension))
Matt Perry 2013/04/19 18:50:44 nit: remove the if. Should be harmless to clear th
971 extension_runtime_data_[extension->id()].background_page_ready = false;
972
969 // Move it over to the disabled list. Don't send a second unload notification 973 // Move it over to the disabled list. Don't send a second unload notification
970 // for terminated extensions being disabled. 974 // for terminated extensions being disabled.
971 disabled_extensions_.Insert(make_scoped_refptr(extension)); 975 disabled_extensions_.Insert(make_scoped_refptr(extension));
972 if (extensions_.Contains(extension->id())) { 976 if (extensions_.Contains(extension->id())) {
973 extensions_.Remove(extension->id()); 977 extensions_.Remove(extension->id());
974 NotifyExtensionUnloaded(extension, extension_misc::UNLOAD_REASON_DISABLE); 978 NotifyExtensionUnloaded(extension, extension_misc::UNLOAD_REASON_DISABLE);
975 } else { 979 } else {
976 terminated_extensions_.Remove(extension->id()); 980 terminated_extensions_.Remove(extension->id());
977 } 981 }
978 982
(...skipping 2105 matching lines...) Expand 10 before | Expand all | Expand 10 after
3084 } 3088 }
3085 3089
3086 void ExtensionService::AddUpdateObserver(extensions::UpdateObserver* observer) { 3090 void ExtensionService::AddUpdateObserver(extensions::UpdateObserver* observer) {
3087 update_observers_.AddObserver(observer); 3091 update_observers_.AddObserver(observer);
3088 } 3092 }
3089 3093
3090 void ExtensionService::RemoveUpdateObserver( 3094 void ExtensionService::RemoveUpdateObserver(
3091 extensions::UpdateObserver* observer) { 3095 extensions::UpdateObserver* observer) {
3092 update_observers_.RemoveObserver(observer); 3096 update_observers_.RemoveObserver(observer);
3093 } 3097 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698