Index: ui/app_list/views/apps_grid_view.cc |
diff --git a/ui/app_list/views/apps_grid_view.cc b/ui/app_list/views/apps_grid_view.cc |
index 9b32f2e88fec40346811f2212d51c3ad05a95924..13763d9d8e9e41879507912e723819af12f86cd9 100644 |
--- a/ui/app_list/views/apps_grid_view.cc |
+++ b/ui/app_list/views/apps_grid_view.cc |
@@ -19,6 +19,7 @@ |
#include "ui/app_list/views/app_list_folder_view.h" |
#include "ui/app_list/views/app_list_item_view.h" |
#include "ui/app_list/views/apps_grid_view_delegate.h" |
+#include "ui/app_list/views/apps_grid_view_folder_delegate.h" |
#include "ui/app_list/views/page_switcher.h" |
#include "ui/app_list/views/pulsing_block_view.h" |
#include "ui/app_list/views/top_icon_animation_view.h" |
@@ -392,7 +393,8 @@ void AppsGridView::SetLayout(int icon_size, int cols, int rows_per_page) { |
void AppsGridView::ResetForShowApps() { |
activated_folder_item_view_ = NULL; |
ClearDragState(); |
- layer()->SetOpacity(1.0f); |
+ if (layer()) |
+ layer()->SetOpacity(1.0f); |
SetVisible(true); |
// Set all views to visible in case they weren't made visible again by an |
// incomplete animation. |
@@ -841,6 +843,10 @@ bool AppsGridView::IsAnimatingView(views::View* view) { |
return bounds_animator_.IsAnimating(view); |
} |
+const char* AppsGridView::GetClassName() const { |
+ return "GridView"; |
+} |
+ |
gfx::Size AppsGridView::GetPreferredSize() const { |
const gfx::Insets insets(GetInsets()); |
const gfx::Size tile_size = gfx::Size(kPreferredTileWidth, |
@@ -1003,10 +1009,8 @@ views::View* AppsGridView::CreateViewForItemAtIndex(size_t index) { |
AppListItemView* view = new AppListItemView(this, |
item_list_->item_at(index)); |
view->SetIconSize(icon_size_); |
-#if defined(USE_AURA) |
view->SetPaintToLayer(true); |
view->SetFillsBoundsOpaquely(false); |
-#endif |
return view; |
} |
@@ -1232,7 +1236,6 @@ void AppsGridView::AnimationBetweenRows(views::View* view, |
const int dir = current_page < target_page || |
(current_page == target_page && current.y() < target.y()) ? 1 : -1; |
-#if defined(USE_AURA) |
scoped_ptr<ui::Layer> layer; |
if (animate_current) { |
layer = view->RecreateLayer(); |
@@ -1244,7 +1247,6 @@ void AppsGridView::AnimationBetweenRows(views::View* view, |
gfx::Rect current_out(current); |
current_out.Offset(dir * kPreferredTileWidth, 0); |
-#endif |
gfx::Rect target_in(target); |
if (animate_target) |
@@ -1252,12 +1254,10 @@ void AppsGridView::AnimationBetweenRows(views::View* view, |
view->SetBoundsRect(target_in); |
bounds_animator_.AnimateViewTo(view, target); |
-#if defined(USE_AURA) |
bounds_animator_.SetAnimationDelegate( |
view, |
new RowMoveAnimationDelegate(view, layer.release(), current_out), |
true); |
-#endif |
} |
void AppsGridView::ExtractDragLocation(const ui::LocatedEvent& event, |
@@ -1281,6 +1281,7 @@ void AppsGridView::ExtractDragLocation(const ui::LocatedEvent& event, |
// For non-aura, root location is not clearly defined but |drag_view_| does |
// not have the scale transform. So no round error would be introduced and |
// it's okay to use View::ConvertPointToTarget. |
+ // TODO(tapted): Investigate round error. |
*drag_point = event.location(); |
views::View::ConvertPointToTarget(drag_view_, this, drag_point); |
#endif |
@@ -1948,13 +1949,11 @@ void AppsGridView::OnAppListModelStatusChanged() { |
} |
void AppsGridView::SetViewHidden(views::View* view, bool hide, bool immediate) { |
-#if defined(USE_AURA) |
ui::ScopedLayerAnimationSettings animator(view->layer()->GetAnimator()); |
animator.SetPreemptionStrategy( |
immediate ? ui::LayerAnimator::IMMEDIATELY_SET_NEW_TARGET : |
ui::LayerAnimator::BLEND_WITH_CURRENT_ANIMATION); |
view->layer()->SetOpacity(hide ? 0 : 1); |
-#endif |
} |
void AppsGridView::OnImplicitAnimationsCompleted() { |