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/extension_menu_manager.h" | 5 #include "chrome/browser/extensions/extension_menu_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 } | 446 } |
447 | 447 |
448 void ExtensionMenuManager::Observe(NotificationType type, | 448 void ExtensionMenuManager::Observe(NotificationType type, |
449 const NotificationSource& source, | 449 const NotificationSource& source, |
450 const NotificationDetails& details) { | 450 const NotificationDetails& details) { |
451 // Remove menu items for disabled/uninstalled extensions. | 451 // Remove menu items for disabled/uninstalled extensions. |
452 if (type != NotificationType::EXTENSION_UNLOADED) { | 452 if (type != NotificationType::EXTENSION_UNLOADED) { |
453 NOTREACHED(); | 453 NOTREACHED(); |
454 return; | 454 return; |
455 } | 455 } |
456 const Extension* extension = Details<const Extension>(details).ptr(); | 456 const Extension* extension = |
| 457 Details<UnloadedExtensionInfo>(details)->extension; |
457 if (ContainsKey(context_items_, extension->id())) { | 458 if (ContainsKey(context_items_, extension->id())) { |
458 RemoveAllContextItems(extension->id()); | 459 RemoveAllContextItems(extension->id()); |
459 } | 460 } |
460 } | 461 } |
461 | 462 |
462 const SkBitmap& ExtensionMenuManager::GetIconForExtension( | 463 const SkBitmap& ExtensionMenuManager::GetIconForExtension( |
463 const std::string& extension_id) { | 464 const std::string& extension_id) { |
464 return icon_manager_.GetIcon(extension_id); | 465 return icon_manager_.GetIcon(extension_id); |
465 } | 466 } |
466 | 467 |
(...skipping 28 matching lines...) Expand all Loading... |
495 if (profile < other.profile) | 496 if (profile < other.profile) |
496 return true; | 497 return true; |
497 if (profile == other.profile) { | 498 if (profile == other.profile) { |
498 if (extension_id < other.extension_id) | 499 if (extension_id < other.extension_id) |
499 return true; | 500 return true; |
500 if (extension_id == other.extension_id) | 501 if (extension_id == other.extension_id) |
501 return uid < other.uid; | 502 return uid < other.uid; |
502 } | 503 } |
503 return false; | 504 return false; |
504 } | 505 } |
OLD | NEW |