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/api/commands/command_service.h" | 5 #include "chrome/browser/extensions/api/commands/command_service.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/extensions/api/commands/commands.h" | 10 #include "chrome/browser/extensions/api/commands/commands.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 return false; | 55 return false; |
56 | 56 |
57 return assigned; | 57 return assigned; |
58 } | 58 } |
59 | 59 |
60 } // namespace | 60 } // namespace |
61 | 61 |
62 namespace extensions { | 62 namespace extensions { |
63 | 63 |
64 // static | 64 // static |
65 void CommandService::RegisterUserPrefs( | 65 void CommandService::RegisterProfilePrefs( |
66 user_prefs::PrefRegistrySyncable* registry) { | 66 user_prefs::PrefRegistrySyncable* registry) { |
67 registry->RegisterDictionaryPref( | 67 registry->RegisterDictionaryPref( |
68 prefs::kExtensionCommands, | 68 prefs::kExtensionCommands, |
69 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | 69 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
70 } | 70 } |
71 | 71 |
72 CommandService::CommandService(Profile* profile) | 72 CommandService::CommandService(Profile* profile) |
73 : profile_(profile) { | 73 : profile_(profile) { |
74 ExtensionFunctionRegistry::GetInstance()-> | 74 ExtensionFunctionRegistry::GetInstance()-> |
75 RegisterFunction<GetAllCommandsFunction>(); | 75 RegisterFunction<GetAllCommandsFunction>(); |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 return false; | 397 return false; |
398 | 398 |
399 *command = *requested_command; | 399 *command = *requested_command; |
400 if (shortcut_assigned.key_code() != ui::VKEY_UNKNOWN) | 400 if (shortcut_assigned.key_code() != ui::VKEY_UNKNOWN) |
401 command->set_accelerator(shortcut_assigned); | 401 command->set_accelerator(shortcut_assigned); |
402 | 402 |
403 return true; | 403 return true; |
404 } | 404 } |
405 | 405 |
406 } // namespace extensions | 406 } // namespace extensions |
OLD | NEW |