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

Side by Side Diff: chrome/browser/extensions/menu_manager.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
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/menu_manager.h" 5 #include "chrome/browser/extensions/menu_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 #include <tuple> 9 #include <tuple>
10 #include <utility> 10 #include <utility>
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after
848 store_->GetExtensionValue( 848 store_->GetExtensionValue(
849 extension->id(), 849 extension->id(),
850 kContextMenusKey, 850 kContextMenusKey,
851 base::Bind( 851 base::Bind(
852 &MenuManager::ReadFromStorage, AsWeakPtr(), extension->id())); 852 &MenuManager::ReadFromStorage, AsWeakPtr(), extension->id()));
853 } 853 }
854 } 854 }
855 855
856 void MenuManager::OnExtensionUnloaded(content::BrowserContext* browser_context, 856 void MenuManager::OnExtensionUnloaded(content::BrowserContext* browser_context,
857 const Extension* extension, 857 const Extension* extension,
858 UnloadedExtensionInfo::Reason reason) { 858 UnloadedExtensionReason reason) {
859 MenuItem::ExtensionKey extension_key(extension->id()); 859 MenuItem::ExtensionKey extension_key(extension->id());
860 if (base::ContainsKey(context_items_, extension_key)) { 860 if (base::ContainsKey(context_items_, extension_key)) {
861 RemoveAllContextItems(extension_key); 861 RemoveAllContextItems(extension_key);
862 } 862 }
863 } 863 }
864 864
865 void MenuManager::Observe(int type, 865 void MenuManager::Observe(int type,
866 const content::NotificationSource& source, 866 const content::NotificationSource& source,
867 const content::NotificationDetails& details) { 867 const content::NotificationDetails& details) {
868 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_DESTROYED, type); 868 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_DESTROYED, type);
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
968 bool MenuItem::Id::operator!=(const Id& other) const { 968 bool MenuItem::Id::operator!=(const Id& other) const {
969 return !(*this == other); 969 return !(*this == other);
970 } 970 }
971 971
972 bool MenuItem::Id::operator<(const Id& other) const { 972 bool MenuItem::Id::operator<(const Id& other) const {
973 return std::tie(incognito, extension_key, uid, string_uid) < 973 return std::tie(incognito, extension_key, uid, string_uid) <
974 std::tie(other.incognito, other.extension_key, other.uid, other.string_uid); 974 std::tie(other.incognito, other.extension_key, other.uid, other.string_uid);
975 } 975 }
976 976
977 } // namespace extensions 977 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/menu_manager.h ('k') | chrome/browser/extensions/menu_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698