Commit 12981593 authored by mlcui's avatar mlcui Committed by Commit Bot

Shortcut viewer: Update documentation

Fixes some typos and clarifies some behaviour.

Change-Id: I5fc6383c7390f908bbe8b33e0b883e704461f0b3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2512489Reviewed-by: default avatarTao Wu <wutao@chromium.org>
Commit-Queue: Michael Cui <mlcui@google.com>
Cr-Commit-Position: refs/heads/master@{#823440}
parent c3b9f252
......@@ -91,14 +91,15 @@ struct KSV_EXPORT KeyboardShortcutItem {
// the |shortcut_key_codes|.
// 4. For ksv items not in the two accelerator_tables, we will provide the
// |shortcut_key_codes| and |accelerator_ids| will be empty.
// As of writing, this vector never has more than 1 accelerator in it.
std::vector<AcceleratorId> accelerator_ids;
// The VKEY codes of the key and each modifier comprising the shortcut. These
// are translated to text or icons representing each key, and substituted into
// the shortcut-message template string, to display to the user.
// For example of shortcut "Alt + left arrow", |shortcut_key_codes| will be
// {ui::VKEY_LMENU, ui::VKEY_LEFT}. ui::VKEY_LMENU indicates to display a text
// "Alt" and ui::VKEY_LEFT insidcates to display an icon of "left arrow".
// For example, for the shortcut "Alt + left arrow", |shortcut_key_codes| will
// be {ui::VKEY_LMENU, ui::VKEY_UNKNOWN, ui::VKEY_LEFT} representing "Alt",
// the separator and a left arrow respectively.
// Note that the modifier is converted to ui::KeyboardCode so that there is
// only one enum type to deal with.
std::vector<ui::KeyboardCode> shortcut_key_codes;
......
......@@ -1445,7 +1445,7 @@ const std::vector<KeyboardShortcutItem>& GetKeyboardShortcutItemList() {
// Only use the first |accelerator_id| because the modifiers are the
// same even if it is a grouped accelerators.
const AcceleratorId& accelerator_id = item.accelerator_ids[0];
// Insert |shortcut_key_codes| by the order of CTLR, ALT, SHIFT, SEARCH,
// Insert |shortcut_key_codes| by the order of CTRL, ALT, SHIFT, SEARCH,
// and then key, to be consistent with how we describe it in the
// |shortcut_message_id| associated string template.
for (auto modifier : {ui::EF_CONTROL_DOWN, ui::EF_ALT_DOWN,
......
......@@ -28,7 +28,7 @@ GetKeyboardShortcutItemList();
base::string16 GetStringForCategory(ShortcutCategory category);
// Returns the string of a DomeKey for a given VKEY. VKEY needs to be mapped to
// Returns the string of a DomKey for a given VKEY. VKEY needs to be mapped to
// a physical key |dom_code| and then the |dom_code| needs to be mapped to a
// meaning or character of |dom_key| based on the corresponding keyboard layout.
// Returns empty string if the |dom_key| IsDeadKey or has no mapped meaning or
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment