Roll src/third_party/skia 591a2ca:b3fe1b8
[chromium-blink-merge.git] / ui / app_list / views / app_list_page.h
blob08ecf251dfc568dfb7c13c504a81a400be1c0f53
1 // Copyright 2015 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_APP_LIST_PAGE_H_
6 #define UI_APP_LIST_VIEWS_APP_LIST_PAGE_H_
8 #include "ui/app_list/app_list_export.h"
9 #include "ui/app_list/app_list_model.h"
10 #include "ui/views/view.h"
12 namespace app_list {
14 class ContentsView;
16 class APP_LIST_EXPORT AppListPage : public views::View {
17 public:
18 // Triggered when the page is about to be shown.
19 virtual void OnWillBeShown();
21 // Triggered after the page has been shown.
22 virtual void OnShown();
24 // Triggered when the page is about to be hidden.
25 virtual void OnWillBeHidden();
27 // Triggered after the page has been hidden.
28 virtual void OnHidden();
30 // Triggered after the animation has updated.
31 virtual void OnAnimationUpdated(double progress,
32 AppListModel::State from_state,
33 AppListModel::State to_state);
35 // Returns where this page should move to when the given state is active.
36 virtual gfx::Rect GetPageBoundsForState(AppListModel::State state) const = 0;
38 // Returns where the search box should be when this page is shown. Is at the
39 // top of the app list by default, in the contents view's coordinate space.
40 virtual gfx::Rect GetSearchBoxBounds() const;
42 // Returns the z height of the search box for this page.
43 virtual int GetSearchBoxZHeight() const;
45 void set_contents_view(ContentsView* contents_view) {
46 contents_view_ = contents_view;
49 protected:
50 AppListPage();
51 ~AppListPage() override;
53 // Returns the area above the contents view, given the desired size of this
54 // page, in the contents view's coordinate space.
55 gfx::Rect GetAboveContentsOffscreenBounds(const gfx::Size& size) const;
57 // Returns the area below the contents view, given the desired size of this
58 // page, in the contents view's coordinate space.
59 gfx::Rect GetBelowContentsOffscreenBounds(const gfx::Size& size) const;
61 // Returns the entire bounds of the contents view, in the contents view's
62 // coordinate space.
63 gfx::Rect GetFullContentsBounds() const;
65 // Returns the default bounds of pages inside the contents view, in the
66 // contents view's coordinate space. This is the area of the contents view
67 // below the search box.
68 gfx::Rect GetDefaultContentsBounds() const;
70 private:
71 ContentsView* contents_view_;
73 DISALLOW_COPY_AND_ASSIGN(AppListPage);
76 } // namespace app_list
78 #endif // UI_APP_LIST_VIEWS_APP_LIST_PAGE_H_