Supervised user whitelists: Cleanup
[chromium-blink-merge.git] / ui / app_list / views / search_result_page_view.h
blob31d8dd886c6cc80d6809a910f7c7a656738199a7
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/app_list/views/app_list_page.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 AppListPage {
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 // AppListPage overrides:
44 gfx::Rect GetPageBoundsForState(AppListModel::State state) const override;
45 void OnAnimationUpdated(double progress,
46 AppListModel::State from_state,
47 AppListModel::State to_state) override;
48 int GetSearchBoxZHeight() const override;
50 private:
51 // |directional_movement| is true if the navigation was caused by directional
52 // controls (eg, arrow keys), as opposed to linear controls (eg, Tab).
53 void SetSelectedIndex(int index, bool directional_movement);
54 bool IsValidSelectionIndex(int index);
56 // The SearchResultContainerViews that compose the search page. All owned by
57 // the views hierarchy.
58 std::vector<SearchResultContainerView*> result_container_views_;
60 int selected_index_;
62 DISALLOW_COPY_AND_ASSIGN(SearchResultPageView);
65 } // namespace app_list
67 #endif // UI_APP_LIST_VIEWS_SEARCH_RESULT_PAGE_VIEW_H_