| 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_keybinding_registry.h" | 5 #include "chrome/browser/extensions/extension_keybinding_registry.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/browser/extensions/active_tab_permission_granter.h" | 10 #include "chrome/browser/extensions/active_tab_permission_granter.h" |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 void ExtensionKeybindingRegistry::OnExtensionLoaded( | 175 void ExtensionKeybindingRegistry::OnExtensionLoaded( |
| 176 content::BrowserContext* browser_context, | 176 content::BrowserContext* browser_context, |
| 177 const Extension* extension) { | 177 const Extension* extension) { |
| 178 if (ExtensionMatchesFilter(extension)) | 178 if (ExtensionMatchesFilter(extension)) |
| 179 AddExtensionKeybindings(extension, std::string()); | 179 AddExtensionKeybindings(extension, std::string()); |
| 180 } | 180 } |
| 181 | 181 |
| 182 void ExtensionKeybindingRegistry::OnExtensionUnloaded( | 182 void ExtensionKeybindingRegistry::OnExtensionUnloaded( |
| 183 content::BrowserContext* browser_context, | 183 content::BrowserContext* browser_context, |
| 184 const Extension* extension, | 184 const Extension* extension, |
| 185 UnloadedExtensionInfo::Reason reason) { | 185 UnloadedExtensionReason reason) { |
| 186 if (ExtensionMatchesFilter(extension)) | 186 if (ExtensionMatchesFilter(extension)) |
| 187 RemoveExtensionKeybinding(extension, std::string()); | 187 RemoveExtensionKeybinding(extension, std::string()); |
| 188 } | 188 } |
| 189 | 189 |
| 190 void ExtensionKeybindingRegistry::Observe( | 190 void ExtensionKeybindingRegistry::Observe( |
| 191 int type, | 191 int type, |
| 192 const content::NotificationSource& source, | 192 const content::NotificationSource& source, |
| 193 const content::NotificationDetails& details) { | 193 const content::NotificationDetails& details) { |
| 194 switch (type) { | 194 switch (type) { |
| 195 case extensions::NOTIFICATION_EXTENSION_COMMAND_ADDED: | 195 case extensions::NOTIFICATION_EXTENSION_COMMAND_ADDED: |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 if (extension_id.empty() || it->first == extension_id) { | 257 if (extension_id.empty() || it->first == extension_id) { |
| 258 CommandExecuted(it->first, it->second); | 258 CommandExecuted(it->first, it->second); |
| 259 executed = true; | 259 executed = true; |
| 260 } | 260 } |
| 261 } | 261 } |
| 262 | 262 |
| 263 return executed; | 263 return executed; |
| 264 } | 264 } |
| 265 | 265 |
| 266 } // namespace extensions | 266 } // namespace extensions |
| OLD | NEW |