ozone: evdev: Sync caps lock LED state to evdev
[chromium-blink-merge.git] / ui / app_list / views / search_result_page_view.h
blobd01c0a43e77c67da6077daf89eea3843f667ac70
1 // Copyright 2014 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.
5 #ifndef UI_APP_LIST_VIEWS_SEARCH_RESULT_PAGE_VIEW_H_
6 #define UI_APP_LIST_VIEWS_SEARCH_RESULT_PAGE_VIEW_H_
8 #include <vector>
10 #include "base/basictypes.h"
11 #include "base/memory/weak_ptr.h"
12 #include "ui/app_list/app_list_export.h"
13 #include "ui/app_list/app_list_model.h"
14 #include "ui/views/view.h"
16 namespace app_list {
18 class AppListMainView;
19 class AppListViewDelegate;
20 class SearchResultContainerView;
22 // The start page for the experimental app list.
23 class APP_LIST_EXPORT SearchResultPageView : public views::View {
24 public:
25 SearchResultPageView();
26 ~SearchResultPageView() override;
28 int selected_index() { return selected_index_; }
29 void SetSelection(bool select); // Set or unset result selection.
31 void AddSearchResultContainerView(
32 AppListModel::SearchResults* result_model,
33 SearchResultContainerView* result_container);
35 const std::vector<SearchResultContainerView*>& result_container_views() {
36 return result_container_views_;
39 // Overridden from views::View:
40 bool OnKeyPressed(const ui::KeyEvent& event) override;
41 void ChildPreferredSizeChanged(views::View* child) override;
43 private:
44 // |directional_movement| is true if the navigation was caused by directional
45 // controls (eg, arrow keys), as opposed to linear controls (eg, Tab).
46 void SetSelectedIndex(int index, bool directional_movement);
47 bool IsValidSelectionIndex(int index);
49 // The SearchResultContainerViews that compose the search page. All owned by
50 // the views hierarchy.
51 std::vector<SearchResultContainerView*> result_container_views_;
53 int selected_index_;
55 DISALLOW_COPY_AND_ASSIGN(SearchResultPageView);
58 } // namespace app_list
60 #endif // UI_APP_LIST_VIEWS_SEARCH_RESULT_PAGE_VIEW_H_