Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(190)

Side by Side Diff: chrome/common/extensions/command.cc

Issue 674263003: Add remaining text/caret navigation commands to ChromeVox Next. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@integrate_cursor
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/common/extensions/command.h" 5 #include "chrome/common/extensions/command.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/strings/string_split.h" 9 #include "base/strings/string_split.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 errors::kInvalidKeyBindingUnknownPlatform, 55 errors::kInvalidKeyBindingUnknownPlatform,
56 base::IntToString(index), 56 base::IntToString(index),
57 platform_key); 57 platform_key);
58 return ui::Accelerator(); 58 return ui::Accelerator();
59 } 59 }
60 60
61 std::vector<std::string> tokens; 61 std::vector<std::string> tokens;
62 base::SplitString(accelerator, '+', &tokens); 62 base::SplitString(accelerator, '+', &tokens);
63 if (tokens.size() == 0 || 63 if (tokens.size() == 0 ||
64 (tokens.size() == 1 && DoesRequireModifier(accelerator)) || 64 (tokens.size() == 1 && DoesRequireModifier(accelerator)) ||
65 tokens.size() > 3) { 65 tokens.size() > 4) {
66 *error = ErrorUtils::FormatErrorMessageUTF16( 66 *error = ErrorUtils::FormatErrorMessageUTF16(
67 errors::kInvalidKeyBinding, 67 errors::kInvalidKeyBinding,
68 base::IntToString(index), 68 base::IntToString(index),
69 platform_key, 69 platform_key,
70 accelerator); 70 accelerator);
71 return ui::Accelerator(); 71 return ui::Accelerator();
72 } 72 }
73 73
74 // Now, parse it into an accelerator. 74 // Now, parse it into an accelerator.
75 int modifiers = ui::EF_NONE; 75 int modifiers = ui::EF_NONE;
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 extension_data->SetBoolean("active", active); 548 extension_data->SetBoolean("active", active);
549 extension_data->SetString("keybinding", accelerator().GetShortcutText()); 549 extension_data->SetString("keybinding", accelerator().GetShortcutText());
550 extension_data->SetString("command_name", command_name()); 550 extension_data->SetString("command_name", command_name());
551 extension_data->SetString("extension_id", extension->id()); 551 extension_data->SetString("extension_id", extension->id());
552 extension_data->SetBoolean("global", global()); 552 extension_data->SetBoolean("global", global());
553 extension_data->SetBoolean("extension_action", extension_action); 553 extension_data->SetBoolean("extension_action", extension_action);
554 return extension_data; 554 return extension_data;
555 } 555 }
556 556
557 } // namespace extensions 557 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698