Commit e83ed094 authored by calamity's avatar calamity Committed by Commit bot

Remove the apps grid page switcher from the experimental app list.

This CL removes the page switcher from the experimental app list's apps
grid view. The normal app list should be unaffected.

BUG=406222

Review URL: https://codereview.chromium.org/521823004

Cr-Commit-Position: refs/heads/master@{#292905}
parent 97454ffa
...@@ -62,6 +62,7 @@ const int kDragBufferPx = 20; ...@@ -62,6 +62,7 @@ const int kDragBufferPx = 20;
// Padding space in pixels for fixed layout. // Padding space in pixels for fixed layout.
const int kLeftRightPadding = 20; const int kLeftRightPadding = 20;
const int kTopPadding = 1; const int kTopPadding = 1;
const int kBottomPadding = 24;
// Padding space in pixels between pages. // Padding space in pixels between pages.
const int kPagePadding = 40; const int kPagePadding = 40;
...@@ -372,8 +373,10 @@ AppsGridView::AppsGridView(AppsGridViewDelegate* delegate) ...@@ -372,8 +373,10 @@ AppsGridView::AppsGridView(AppsGridViewDelegate* delegate)
: PaginationController::SCROLL_AXIS_HORIZONTAL; : PaginationController::SCROLL_AXIS_HORIZONTAL;
pagination_controller_.reset( pagination_controller_.reset(
new PaginationController(&pagination_model_, scroll_axis)); new PaginationController(&pagination_model_, scroll_axis));
page_switcher_view_ = new PageSwitcher(&pagination_model_); if (!switches::IsExperimentalAppListEnabled()) {
AddChildView(page_switcher_view_); page_switcher_view_ = new PageSwitcher(&pagination_model_);
AddChildView(page_switcher_view_);
}
} }
AppsGridView::~AppsGridView() { AppsGridView::~AppsGridView() {
...@@ -622,10 +625,12 @@ void AppsGridView::UpdateDrag(Pointer pointer, const gfx::Point& point) { ...@@ -622,10 +625,12 @@ void AppsGridView::UpdateDrag(Pointer pointer, const gfx::Point& point) {
else else
StopPageFlipTimer(); StopPageFlipTimer();
gfx::Point page_switcher_point(last_drag_point_); if (page_switcher_view_) {
views::View::ConvertPointToTarget(this, page_switcher_view_, gfx::Point page_switcher_point(last_drag_point_);
&page_switcher_point); views::View::ConvertPointToTarget(
page_switcher_view_->UpdateUIForDragPoint(page_switcher_point); this, page_switcher_view_, &page_switcher_point);
page_switcher_view_->UpdateUIForDragPoint(page_switcher_point);
}
if (!EnableFolderDragDropUI()) { if (!EnableFolderDragDropUI()) {
if (last_drop_target != drop_target_) if (last_drop_target != drop_target_)
...@@ -875,8 +880,9 @@ gfx::Size AppsGridView::GetPreferredSize() const { ...@@ -875,8 +880,9 @@ gfx::Size AppsGridView::GetPreferredSize() const {
const gfx::Insets insets(GetInsets()); const gfx::Insets insets(GetInsets());
const gfx::Size tile_size = gfx::Size(kPreferredTileWidth, const gfx::Size tile_size = gfx::Size(kPreferredTileWidth,
kPreferredTileHeight); kPreferredTileHeight);
const int page_switcher_height = int page_switcher_height = kBottomPadding;
page_switcher_view_->GetPreferredSize().height(); if (page_switcher_view_)
page_switcher_height = page_switcher_view_->GetPreferredSize().height();
return gfx::Size( return gfx::Size(
tile_size.width() * cols_ + insets.width(), tile_size.width() * cols_ + insets.width(),
tile_size.height() * rows_per_page_ + tile_size.height() * rows_per_page_ +
...@@ -911,12 +917,14 @@ void AppsGridView::Layout() { ...@@ -911,12 +917,14 @@ void AppsGridView::Layout() {
} }
views::ViewModelUtils::SetViewBoundsToIdealBounds(pulsing_blocks_model_); views::ViewModelUtils::SetViewBoundsToIdealBounds(pulsing_blocks_model_);
const int page_switcher_height = if (page_switcher_view_) {
page_switcher_view_->GetPreferredSize().height(); const int page_switcher_height =
gfx::Rect rect(GetContentsBounds()); page_switcher_view_->GetPreferredSize().height();
rect.set_y(rect.bottom() - page_switcher_height); gfx::Rect rect(GetContentsBounds());
rect.set_height(page_switcher_height); rect.set_y(rect.bottom() - page_switcher_height);
page_switcher_view_->SetBoundsRect(rect); rect.set_height(page_switcher_height);
page_switcher_view_->SetBoundsRect(rect);
}
} }
bool AppsGridView::OnKeyPressed(const ui::KeyEvent& event) { bool AppsGridView::OnKeyPressed(const ui::KeyEvent& event) {
...@@ -1364,7 +1372,7 @@ void AppsGridView::CalculateDropTarget(const gfx::Point& drag_point, ...@@ -1364,7 +1372,7 @@ void AppsGridView::CalculateDropTarget(const gfx::Point& drag_point,
current_page = drag_start_page_; current_page = drag_start_page_;
} }
if (use_page_button_hovering && if (use_page_button_hovering && page_switcher_view_ &&
page_switcher_view_->bounds().Contains(point)) { page_switcher_view_->bounds().Contains(point)) {
gfx::Point page_switcher_point(point); gfx::Point page_switcher_point(point);
views::View::ConvertPointToTarget(this, page_switcher_view_, views::View::ConvertPointToTarget(this, page_switcher_view_,
...@@ -1403,7 +1411,7 @@ void AppsGridView::CalculateDropTargetWithFolderEnabled( ...@@ -1403,7 +1411,7 @@ void AppsGridView::CalculateDropTargetWithFolderEnabled(
point = drag_start_grid_view_; point = drag_start_grid_view_;
} }
if (use_page_button_hovering && if (use_page_button_hovering && page_switcher_view_ &&
page_switcher_view_->bounds().Contains(point)) { page_switcher_view_->bounds().Contains(point)) {
gfx::Point page_switcher_point(point); gfx::Point page_switcher_point(point);
views::View::ConvertPointToTarget(this, page_switcher_view_, views::View::ConvertPointToTarget(this, page_switcher_view_,
...@@ -1644,7 +1652,8 @@ void AppsGridView::MaybeStartPageFlipTimer(const gfx::Point& drag_point) { ...@@ -1644,7 +1652,8 @@ void AppsGridView::MaybeStartPageFlipTimer(const gfx::Point& drag_point) {
StopPageFlipTimer(); StopPageFlipTimer();
int new_page_flip_target = -1; int new_page_flip_target = -1;
if (page_switcher_view_->bounds().Contains(drag_point)) { if (page_switcher_view_ &&
page_switcher_view_->bounds().Contains(drag_point)) {
gfx::Point page_switcher_point(drag_point); gfx::Point page_switcher_point(drag_point);
views::View::ConvertPointToTarget(this, page_switcher_view_, views::View::ConvertPointToTarget(this, page_switcher_view_,
&page_switcher_point); &page_switcher_point);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment