forked from Pissandshittium/pissandshittium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathax_enum_localization_util.cc
40 lines (34 loc) · 1.54 KB
/
ax_enum_localization_util.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ui/accessibility/ax_enum_localization_util.h"
#include "ui/accessibility/ax_enums.mojom.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/strings/grit/ax_strings.h"
namespace ui {
std::string ToLocalizedString(ax::mojom::DefaultActionVerb action_verb) {
switch (action_verb) {
case ax::mojom::DefaultActionVerb::kNone:
return "";
case ax::mojom::DefaultActionVerb::kActivate:
return l10n_util::GetStringUTF8(IDS_AX_ACTIVATE_ACTION_VERB);
case ax::mojom::DefaultActionVerb::kCheck:
return l10n_util::GetStringUTF8(IDS_AX_CHECK_ACTION_VERB);
case ax::mojom::DefaultActionVerb::kClick:
return l10n_util::GetStringUTF8(IDS_AX_CLICK_ACTION_VERB);
case ax::mojom::DefaultActionVerb::kClickAncestor:
return l10n_util::GetStringUTF8(IDS_AX_CLICK_ANCESTOR_ACTION_VERB);
case ax::mojom::DefaultActionVerb::kJump:
return l10n_util::GetStringUTF8(IDS_AX_JUMP_ACTION_VERB);
case ax::mojom::DefaultActionVerb::kOpen:
return l10n_util::GetStringUTF8(IDS_AX_OPEN_ACTION_VERB);
case ax::mojom::DefaultActionVerb::kPress:
return l10n_util::GetStringUTF8(IDS_AX_PRESS_ACTION_VERB);
case ax::mojom::DefaultActionVerb::kSelect:
return l10n_util::GetStringUTF8(IDS_AX_SELECT_ACTION_VERB);
case ax::mojom::DefaultActionVerb::kUncheck:
return l10n_util::GetStringUTF8(IDS_AX_UNCHECK_ACTION_VERB);
}
return "";
}
} // namespace ui