| 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/ui/webui/extensions/command_handler.h" | 5 #include "chrome/browser/ui/webui/extensions/command_handler.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "chrome/browser/extensions/api/commands/command_service.h" | 9 #include "chrome/browser/extensions/api/commands/command_service.h" |
| 10 #include "chrome/browser/extensions/api/commands/command_service_factory.h" | 10 #include "chrome/browser/extensions/api/commands/command_service_factory.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 | 76 |
| 77 Profile* profile = Profile::FromWebUI(web_ui()); | 77 Profile* profile = Profile::FromWebUI(web_ui()); |
| 78 CommandService* command_service = | 78 CommandService* command_service = |
| 79 CommandServiceFactory::GetForProfile(profile); | 79 CommandServiceFactory::GetForProfile(profile); |
| 80 command_service->UpdateKeybindingPrefs(extension_id, command_name, keystroke); | 80 command_service->UpdateKeybindingPrefs(extension_id, command_name, keystroke); |
| 81 | 81 |
| 82 UpdateCommandDataOnPage(); | 82 UpdateCommandDataOnPage(); |
| 83 } | 83 } |
| 84 | 84 |
| 85 void CommandHandler::HandleSetShortcutHandlingSuspended(const ListValue* args) { | 85 void CommandHandler::HandleSetShortcutHandlingSuspended(const ListValue* args) { |
| 86 #if !defined(OS_MACOSX) | |
| 87 bool suspended; | 86 bool suspended; |
| 88 if (args->GetBoolean(0, &suspended)) | 87 if (args->GetBoolean(0, &suspended)) |
| 89 ExtensionKeybindingRegistry::SetShortcutHandlingSuspended(suspended); | 88 ExtensionKeybindingRegistry::SetShortcutHandlingSuspended(suspended); |
| 90 #else | |
| 91 NOTIMPLEMENTED(); | |
| 92 #endif | |
| 93 } | 89 } |
| 94 | 90 |
| 95 void CommandHandler::GetAllCommands(base::DictionaryValue* commands) { | 91 void CommandHandler::GetAllCommands(base::DictionaryValue* commands) { |
| 96 ListValue* results = new ListValue; | 92 ListValue* results = new ListValue; |
| 97 | 93 |
| 98 Profile* profile = Profile::FromWebUI(web_ui()); | 94 Profile* profile = Profile::FromWebUI(web_ui()); |
| 99 CommandService* command_service = | 95 CommandService* command_service = |
| 100 CommandServiceFactory::GetForProfile(profile); | 96 CommandServiceFactory::GetForProfile(profile); |
| 101 | 97 |
| 102 const ExtensionSet* extensions = extensions::ExtensionSystem::Get(profile)-> | 98 const ExtensionSet* extensions = extensions::ExtensionSystem::Get(profile)-> |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 if (!extensions_list->empty()) { | 150 if (!extensions_list->empty()) { |
| 155 extension_dict->Set("commands", extensions_list.release()); | 151 extension_dict->Set("commands", extensions_list.release()); |
| 156 results->Append(extension_dict.release()); | 152 results->Append(extension_dict.release()); |
| 157 } | 153 } |
| 158 } | 154 } |
| 159 | 155 |
| 160 commands->Set("commands", results); | 156 commands->Set("commands", results); |
| 161 } | 157 } |
| 162 | 158 |
| 163 } // namespace extensions | 159 } // namespace extensions |
| OLD | NEW |