Home | History | Annotate | Download | only in extensions

Lines Matching refs:Accelerator

39 bool DoesRequireModifier(const std::string& accelerator) {
40 return accelerator != values::kKeyMediaNextTrack &&
41 accelerator != values::kKeyMediaPlayPause &&
42 accelerator != values::kKeyMediaPrevTrack &&
43 accelerator != values::kKeyMediaStop;
46 ui::Accelerator ParseImpl(const std::string& accelerator,
61 return ui::Accelerator();
65 base::SplitString(accelerator, '+', &tokens);
67 (tokens.size() == 1 && DoesRequireModifier(accelerator)) ||
73 accelerator);
74 return ui::Accelerator();
77 // Now, parse it into an accelerator.
184 accelerator);
185 return ui::Accelerator();
206 accelerator);
207 return ui::Accelerator();
219 accelerator);
220 return ui::Accelerator();
223 return ui::Accelerator(key, modifiers);
259 const std::string& accelerator,
265 accelerator_ = ParseImpl(accelerator, CommandPlatform(), 0,
287 ui::Accelerator Command::StringToAccelerator(const std::string& accelerator,
290 ui::Accelerator parsed =
291 ParseImpl(accelerator, Command::CommandPlatform(), 0,
297 std::string Command::AcceleratorToString(const ui::Accelerator& accelerator) {
301 if (accelerator.IsCtrlDown())
303 else if (accelerator.IsAltDown())
308 if (accelerator.IsCmdDown()) {
313 if (accelerator.IsShiftDown()) {
318 if (accelerator.key_code() >= ui::VKEY_0 &&
319 accelerator.key_code() <= ui::VKEY_9) {
320 shortcut += '0' + (accelerator.key_code() - ui::VKEY_0);
321 } else if (accelerator.key_code() >= ui::VKEY_A &&
322 accelerator.key_code() <= ui::VKEY_Z) {
323 shortcut += 'A' + (accelerator.key_code() - ui::VKEY_A);
325 switch (accelerator.key_code()) {
484 ui::Accelerator accelerator;
488 accelerator = ParseImpl(iter->second, iter->first, index,
490 if (accelerator.key_code() == ui::VKEY_UNKNOWN) {
504 accelerator_ = accelerator;
530 extension_data->SetString("keybinding", accelerator().GetShortcutText());