Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(339)

Unified Diff: ui/app_list/views/apps_grid_view.cc

Issue 303543004: MacViews: views_examples_with_content_exe working! Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add files Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/app_list/views/apps_grid_view.h ('k') | ui/app_list/views/contents_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « ui/app_list/views/apps_grid_view.h ('k') | ui/app_list/views/contents_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698