[go: nahoru, domu]

blob: a378e03fb0791570260094112259b4e8fc98475c [file] [log] [blame]
wutao5a1b5dc2018-02-12 20:33:001// 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 Oshimae5af41e62020-03-11 22:17:005#ifndef ASH_SHORTCUT_VIEWER_VIEWS_KSV_SEARCH_BOX_VIEW_H_
6#define ASH_SHORTCUT_VIEWER_VIEWS_KSV_SEARCH_BOX_VIEW_H_
wutao5a1b5dc2018-02-12 20:33:007
Jan Wilken Dörriead587c32021-03-11 14:09:278#include <string>
9
James Cook5531b71f2020-09-24 23:16:4610#include "ash/search_box/search_box_view_base.h"
wutao5a1b5dc2018-02-12 20:33:0011#include "base/macros.h"
wutao3d134d7b2018-03-24 05:49:0112#include "base/strings/string16.h"
wutao5a1b5dc2018-02-12 20:33:0013
James Cook55e88392020-09-25 03:57:5514namespace ash {
wutao5a1b5dc2018-02-12 20:33:0015class SearchBoxViewDelegate;
James Cook55e88392020-09-25 03:57:5516} // namespace ash
wutao5a1b5dc2018-02-12 20:33:0017
18namespace keyboard_shortcut_viewer {
19
Darwin Huang663c17d2020-02-06 01:10:0120// A search_box_SearchBoxViewBase implementation for KeyboardShortcutViewer.
James Cook55e88392020-09-25 03:57:5521class KSVSearchBoxView : public ash::SearchBoxViewBase {
wutao5a1b5dc2018-02-12 20:33:0022 public:
James Cook55e88392020-09-25 03:57:5523 explicit KSVSearchBoxView(ash::SearchBoxViewDelegate* delegate);
wutao5a1b5dc2018-02-12 20:33:0024 ~KSVSearchBoxView() override = default;
25
26 // views::View:
27 gfx::Size CalculatePreferredSize() const override;
wutao3d134d7b2018-03-24 05:49:0128 void GetAccessibleNodeData(ui::AXNodeData* node_data) override;
wutaod51700c2018-02-16 23:39:0329 void OnKeyEvent(ui::KeyEvent* event) override;
wutao5a1b5dc2018-02-12 20:33:0030
Jan Wilken Dörrie85285b02021-03-11 23:38:4731 void SetAccessibleValue(const std::u16string& value);
wutao3d134d7b2018-03-24 05:49:0132
Gavin Williamsc02b8952020-10-27 17:29:1533 // SearchBoxViewBase:
34 void OnSearchBoxActiveChanged(bool active) override;
35
wutao5a1b5dc2018-02-12 20:33:0036 private:
James Cook55e88392020-09-25 03:57:5537 // SearchBoxViewBase:
wutao5a1b5dc2018-02-12 20:33:0038 void UpdateBackgroundColor(SkColor color) override;
wutao5a1b5dc2018-02-12 20:33:0039 void UpdateSearchBoxBorder() override;
40 void SetupCloseButton() override;
41 void SetupBackButton() override;
Gavin Williamsc02b8952020-10-27 17:29:1542 void SetPlaceholderTextAttributes();
wutao5a1b5dc2018-02-12 20:33:0043
wutao3d134d7b2018-03-24 05:49:0144 // Accessibility data value. Used to pronounce the number of search results.
Jan Wilken Dörrie85285b02021-03-11 23:38:4745 std::u16string accessible_value_;
wutao3d134d7b2018-03-24 05:49:0146
wutao5a1b5dc2018-02-12 20:33:0047 DISALLOW_COPY_AND_ASSIGN(KSVSearchBoxView);
48};
49
50} // namespace keyboard_shortcut_viewer
51
Mitsuru Oshimae5af41e62020-03-11 22:17:0052#endif // ASH_SHORTCUT_VIEWER_VIEWS_KSV_SEARCH_BOX_VIEW_H_