| 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 "chrome/browser/extensions/active_tab_permission_granter.h" |    7 #include "chrome/browser/extensions/active_tab_permission_granter.h" | 
|    8 #include "chrome/browser/extensions/browser_event_router.h" |    8 #include "chrome/browser/extensions/browser_event_router.h" | 
|    9 #include "chrome/browser/extensions/extension_service.h" |    9 #include "chrome/browser/extensions/extension_service.h" | 
|   10 #include "chrome/browser/extensions/extension_system.h" |   10 #include "chrome/browser/extensions/extension_system.h" | 
| (...skipping 16 matching lines...) Expand all  Loading... | 
|   27   registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_COMMAND_ADDED, |   27   registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_COMMAND_ADDED, | 
|   28                  content::Source<Profile>(profile->GetOriginalProfile())); |   28                  content::Source<Profile>(profile->GetOriginalProfile())); | 
|   29   registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_COMMAND_REMOVED, |   29   registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_COMMAND_REMOVED, | 
|   30                  content::Source<Profile>(profile->GetOriginalProfile())); |   30                  content::Source<Profile>(profile->GetOriginalProfile())); | 
|   31 } |   31 } | 
|   32  |   32  | 
|   33 ExtensionKeybindingRegistry::~ExtensionKeybindingRegistry() { |   33 ExtensionKeybindingRegistry::~ExtensionKeybindingRegistry() { | 
|   34 } |   34 } | 
|   35  |   35  | 
|   36 void ExtensionKeybindingRegistry::Init() { |   36 void ExtensionKeybindingRegistry::Init() { | 
|   37   ExtensionService* service = profile_->GetExtensionService(); |   37   ExtensionService* service = | 
 |   38       extensions::ExtensionSystem::Get(profile_)->extension_service(); | 
|   38   if (!service) |   39   if (!service) | 
|   39     return;  // ExtensionService can be null during testing. |   40     return;  // ExtensionService can be null during testing. | 
|   40  |   41  | 
|   41   const ExtensionSet* extensions = service->extensions(); |   42   const ExtensionSet* extensions = service->extensions(); | 
|   42   ExtensionSet::const_iterator iter = extensions->begin(); |   43   ExtensionSet::const_iterator iter = extensions->begin(); | 
|   43   for (; iter != extensions->end(); ++iter) |   44   for (; iter != extensions->end(); ++iter) | 
|   44     if (ExtensionMatchesFilter(*iter)) |   45     if (ExtensionMatchesFilter(*iter)) | 
|   45       AddExtensionKeybinding(*iter, std::string()); |   46       AddExtensionKeybinding(*iter, std::string()); | 
|   46 } |   47 } | 
|   47  |   48  | 
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  128       return true; |  129       return true; | 
|  129     case PLATFORM_APPS_ONLY: |  130     case PLATFORM_APPS_ONLY: | 
|  130       return extension->is_platform_app(); |  131       return extension->is_platform_app(); | 
|  131     default: |  132     default: | 
|  132       NOTREACHED(); |  133       NOTREACHED(); | 
|  133   } |  134   } | 
|  134   return false; |  135   return false; | 
|  135 } |  136 } | 
|  136  |  137  | 
|  137 }  // namespace extensions |  138 }  // namespace extensions | 
| OLD | NEW |