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 #include "ui/app_list/views/app_list_page.h"
7 #include "ui/app_list/views/contents_view.h"
11 // The default z height for the search box.
12 const int kDefaultSearchBoxZHeight
= 2;
17 AppListPage::AppListPage() : contents_view_(nullptr) {
20 AppListPage::~AppListPage() {
23 void AppListPage::OnShown() {
26 void AppListPage::OnWillBeShown() {
29 void AppListPage::OnHidden() {
32 void AppListPage::OnWillBeHidden() {
35 void AppListPage::OnAnimationUpdated(double progress
,
36 AppListModel::State from_state
,
37 AppListModel::State to_state
) {
40 gfx::Rect
AppListPage::GetSearchBoxBounds() const {
41 DCHECK(contents_view_
);
42 return contents_view_
->GetDefaultSearchBoxBounds();
45 int AppListPage::GetSearchBoxZHeight() const {
46 return kDefaultSearchBoxZHeight
;
49 gfx::Rect
AppListPage::GetAboveContentsOffscreenBounds(
50 const gfx::Size
& size
) const {
52 rect
.set_y(-rect
.height());
56 gfx::Rect
AppListPage::GetBelowContentsOffscreenBounds(
57 const gfx::Size
& size
) const {
58 DCHECK(contents_view_
);
60 rect
.set_y(contents_view_
->GetContentsBounds().height());
64 gfx::Rect
AppListPage::GetFullContentsBounds() const {
65 DCHECK(contents_view_
);
66 return contents_view_
->GetContentsBounds();
69 gfx::Rect
AppListPage::GetDefaultContentsBounds() const {
70 DCHECK(contents_view_
);
71 return contents_view_
->GetDefaultContentsBounds();
74 } // namespace app_list