wutao | 09ba763e | 2018-02-02 01:46:39 | [diff] [blame] | 1 | // Copyright 2018 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
Mitsuru Oshima | e5af41e6 | 2020-03-11 22:17:00 | [diff] [blame] | 5 | #ifndef ASH_SHORTCUT_VIEWER_VIEWS_KEYBOARD_SHORTCUT_ITEM_LIST_VIEW_H_ |
| 6 | #define ASH_SHORTCUT_VIEWER_VIEWS_KEYBOARD_SHORTCUT_ITEM_LIST_VIEW_H_ |
wutao | 09ba763e | 2018-02-02 01:46:39 | [diff] [blame] | 7 | |
wutao | 09ba763e | 2018-02-02 01:46:39 | [diff] [blame] | 8 | #include "ui/views/view.h" |
| 9 | |
| 10 | namespace keyboard_shortcut_viewer { |
| 11 | |
wutao | 5a1b5dc | 2018-02-12 20:33:00 | [diff] [blame] | 12 | // Displays a list of KeyboardShortcutItemView. In search result page, all |
| 13 | // KeyboardShortcutItemView are grouped by ShortcutCategory and can be scrolled |
| 14 | // in a single page. A text label to indicate the ShortcutCategory will be |
| 15 | // diplayed at the beginning of the group of KeyboardShortcutItemView. |
wutao | 09ba763e | 2018-02-02 01:46:39 | [diff] [blame] | 16 | class KeyboardShortcutItemListView : public views::View { |
| 17 | public: |
| 18 | KeyboardShortcutItemListView(); |
| 19 | ~KeyboardShortcutItemListView() override = default; |
| 20 | |
wutao | 5a1b5dc | 2018-02-12 20:33:00 | [diff] [blame] | 21 | // In search result page, a text label is added at the beginning of the group |
| 22 | // of KeyboardShortcutItemView to indicate the ShortcutCategory. |
Jan Wilken Dörrie | 85285b0 | 2021-03-11 23:38:47 | [diff] [blame^] | 23 | void AddCategoryLabel(const std::u16string& text); |
wutao | 09ba763e | 2018-02-02 01:46:39 | [diff] [blame] | 24 | |
wutao | 6c5d2a4 | 2018-02-15 06:44:48 | [diff] [blame] | 25 | // Add a horizontal line to separate the KeyboardShortcutItemView. The last |
| 26 | // item in the list is not followed by the horizontal line. |
| 27 | void AddHorizontalSeparator(); |
wutao | 09ba763e | 2018-02-02 01:46:39 | [diff] [blame] | 28 | |
wutao | 6c5d2a4 | 2018-02-15 06:44:48 | [diff] [blame] | 29 | private: |
wutao | 09ba763e | 2018-02-02 01:46:39 | [diff] [blame] | 30 | DISALLOW_COPY_AND_ASSIGN(KeyboardShortcutItemListView); |
| 31 | }; |
| 32 | |
| 33 | } // namespace keyboard_shortcut_viewer |
| 34 | |
Mitsuru Oshima | e5af41e6 | 2020-03-11 22:17:00 | [diff] [blame] | 35 | #endif // ASH_SHORTCUT_VIEWER_VIEWS_KEYBOARD_SHORTCUT_ITEM_LIST_VIEW_H_ |