| OLD | NEW |
| 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_action_manager.h" | 5 #include "chrome/browser/extensions/extension_action_manager.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "chrome/browser/extensions/api/system_indicator/system_indicator_manage
r_factory.h" | 8 #include "chrome/browser/extensions/api/system_indicator/system_indicator_manage
r_factory.h" |
| 9 #include "chrome/browser/extensions/extension_action.h" | 9 #include "chrome/browser/extensions/extension_action.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 } | 72 } |
| 73 | 73 |
| 74 ExtensionActionManager* ExtensionActionManager::Get( | 74 ExtensionActionManager* ExtensionActionManager::Get( |
| 75 content::BrowserContext* context) { | 75 content::BrowserContext* context) { |
| 76 return ExtensionActionManagerFactory::GetForBrowserContext(context); | 76 return ExtensionActionManagerFactory::GetForBrowserContext(context); |
| 77 } | 77 } |
| 78 | 78 |
| 79 void ExtensionActionManager::OnExtensionUnloaded( | 79 void ExtensionActionManager::OnExtensionUnloaded( |
| 80 content::BrowserContext* browser_context, | 80 content::BrowserContext* browser_context, |
| 81 const Extension* extension, | 81 const Extension* extension, |
| 82 UnloadedExtensionInfo::Reason reason) { | 82 UnloadedExtensionReason reason) { |
| 83 page_actions_.erase(extension->id()); | 83 page_actions_.erase(extension->id()); |
| 84 browser_actions_.erase(extension->id()); | 84 browser_actions_.erase(extension->id()); |
| 85 system_indicators_.erase(extension->id()); | 85 system_indicators_.erase(extension->id()); |
| 86 } | 86 } |
| 87 | 87 |
| 88 namespace { | 88 namespace { |
| 89 | 89 |
| 90 // Returns map[extension_id] if that entry exists. Otherwise, if | 90 // Returns map[extension_id] if that entry exists. Otherwise, if |
| 91 // action_info!=nullptr, creates an ExtensionAction from it, fills in the map, | 91 // action_info!=nullptr, creates an ExtensionAction from it, fills in the map, |
| 92 // and returns that. Otherwise (action_info==nullptr), returns nullptr. | 92 // and returns that. Otherwise (action_info==nullptr), returns nullptr. |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 profile_); | 173 profile_); |
| 174 } | 174 } |
| 175 | 175 |
| 176 ExtensionAction* ExtensionActionManager::GetExtensionAction( | 176 ExtensionAction* ExtensionActionManager::GetExtensionAction( |
| 177 const Extension& extension) const { | 177 const Extension& extension) const { |
| 178 ExtensionAction* action = GetBrowserAction(extension); | 178 ExtensionAction* action = GetBrowserAction(extension); |
| 179 return action ? action : GetPageAction(extension); | 179 return action ? action : GetPageAction(extension); |
| 180 } | 180 } |
| 181 | 181 |
| 182 } // namespace extensions | 182 } // namespace extensions |
| OLD | NEW |