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

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

Issue 398083002: Add "UninstallReason" parameter to ExtensionRegistryObserver::OnExtensionUninstalled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix header file. Created 6 years, 5 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_toolbar_model.h" 5 #include "chrome/browser/extensions/extension_toolbar_model.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/metrics/histogram_base.h" 10 #include "base/metrics/histogram_base.h"
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 185
186 void ExtensionToolbarModel::OnExtensionUnloaded( 186 void ExtensionToolbarModel::OnExtensionUnloaded(
187 content::BrowserContext* browser_context, 187 content::BrowserContext* browser_context,
188 const Extension* extension, 188 const Extension* extension,
189 UnloadedExtensionInfo::Reason reason) { 189 UnloadedExtensionInfo::Reason reason) {
190 RemoveExtension(extension); 190 RemoveExtension(extension);
191 } 191 }
192 192
193 void ExtensionToolbarModel::OnExtensionUninstalled( 193 void ExtensionToolbarModel::OnExtensionUninstalled(
194 content::BrowserContext* browser_context, 194 content::BrowserContext* browser_context,
195 const Extension* extension) { 195 const Extension* extension,
196 extensions::UninstallReason reason) {
196 // Remove the extension id from the ordered list, if it exists (the extension 197 // Remove the extension id from the ordered list, if it exists (the extension
197 // might not be represented in the list because it might not have an icon). 198 // might not be represented in the list because it might not have an icon).
198 ExtensionIdList::iterator pos = 199 ExtensionIdList::iterator pos =
199 std::find(last_known_positions_.begin(), 200 std::find(last_known_positions_.begin(),
200 last_known_positions_.end(), extension->id()); 201 last_known_positions_.end(), extension->id());
201 202
202 if (pos != last_known_positions_.end()) { 203 if (pos != last_known_positions_.end()) {
203 last_known_positions_.erase(pos); 204 last_known_positions_.erase(pos);
204 UpdatePrefs(); 205 UpdatePrefs();
205 } 206 }
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 is_highlighting_ = false; 583 is_highlighting_ = false;
583 if (old_visible_icon_count_ != visible_icon_count_) { 584 if (old_visible_icon_count_ != visible_icon_count_) {
584 SetVisibleIconCount(old_visible_icon_count_); 585 SetVisibleIconCount(old_visible_icon_count_);
585 FOR_EACH_OBSERVER(Observer, observers_, VisibleCountChanged()); 586 FOR_EACH_OBSERVER(Observer, observers_, VisibleCountChanged());
586 } 587 }
587 FOR_EACH_OBSERVER(Observer, observers_, HighlightModeChanged(false)); 588 FOR_EACH_OBSERVER(Observer, observers_, HighlightModeChanged(false));
588 } 589 }
589 } 590 }
590 591
591 } // namespace extensions 592 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_toolbar_model.h ('k') | chrome/browser/extensions/external_install_error.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698