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 "ash/content/keyboard_overlay/keyboard_overlay_view.h" | 5 #include "ash/content/keyboard_overlay/keyboard_overlay_view.h" |
6 | 6 |
7 #include "ash/content/keyboard_overlay/keyboard_overlay_delegate.h" | 7 #include "ash/content/keyboard_overlay/keyboard_overlay_delegate.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "grit/ash_strings.h" | 10 #include "grit/ash_strings.h" |
11 #include "ui/base/l10n/l10n_util.h" | 11 #include "ui/base/l10n/l10n_util.h" |
12 #include "ui/events/event.h" | 12 #include "ui/events/event.h" |
13 #include "ui/views/widget/widget.h" | 13 #include "ui/views/widget/widget.h" |
14 #include "ui/web_dialogs/web_dialog_delegate.h" | 14 #include "ui/web_dialogs/web_dialog_delegate.h" |
15 | 15 |
16 using ui::WebDialogDelegate; | 16 using ui::WebDialogDelegate; |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 // Keys to invoke Cancel (Escape, Ctrl+Alt+/, or Shift+Ctrl+Alt+/, Help, F14). | 20 // Keys to invoke Cancel (Escape, Ctrl+Alt+/, or Shift+Ctrl+Alt+/, Help, F14). |
21 const ash::KeyboardOverlayView::KeyEventData kCancelKeys[] = { | 21 const ash::KeyboardOverlayView::KeyEventData kCancelKeys[] = { |
22 {ui::VKEY_ESCAPE, ui::EF_NONE}, | 22 {ui::VKEY_ESCAPE, ui::EF_NONE}, |
23 {ui::VKEY_OEM_2, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN}, | 23 {ui::VKEY_OEM_2, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN}, |
24 {ui::VKEY_OEM_2, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN}, | 24 {ui::VKEY_OEM_2, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN}, |
25 {ui::VKEY_HELP, ui::EF_NONE}, | 25 {ui::VKEY_HELP, ui::EF_NONE}, |
26 {ui::VKEY_F14, ui::EF_NONE}, | 26 {ui::VKEY_F14, ui::EF_NONE}, |
27 }; | 27 }; |
28 | |
29 } | 28 } |
30 | 29 |
31 namespace ash { | 30 namespace ash { |
32 | 31 |
33 KeyboardOverlayView::KeyboardOverlayView(content::BrowserContext* context, | 32 KeyboardOverlayView::KeyboardOverlayView(content::BrowserContext* context, |
34 WebDialogDelegate* delegate, | 33 WebDialogDelegate* delegate, |
35 WebContentsHandler* handler) | 34 WebContentsHandler* handler) |
36 : views::WebDialogView(context, delegate, handler) {} | 35 : views::WebDialogView(context, delegate, handler) {} |
37 | 36 |
38 KeyboardOverlayView::~KeyboardOverlayView() {} | 37 KeyboardOverlayView::~KeyboardOverlayView() {} |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 // static | 85 // static |
87 void KeyboardOverlayView::GetCancelingKeysForTesting( | 86 void KeyboardOverlayView::GetCancelingKeysForTesting( |
88 std::vector<KeyboardOverlayView::KeyEventData>* canceling_keys) { | 87 std::vector<KeyboardOverlayView::KeyEventData>* canceling_keys) { |
89 CHECK(canceling_keys); | 88 CHECK(canceling_keys); |
90 canceling_keys->clear(); | 89 canceling_keys->clear(); |
91 for (size_t i = 0; i < arraysize(kCancelKeys); ++i) | 90 for (size_t i = 0; i < arraysize(kCancelKeys); ++i) |
92 canceling_keys->push_back(kCancelKeys[i]); | 91 canceling_keys->push_back(kCancelKeys[i]); |
93 } | 92 } |
94 | 93 |
95 } // namespace ash | 94 } // namespace ash |
OLD | NEW |