| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/app_list/views/folder_background_view.h" | 5 #include "ui/app_list/views/folder_background_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ui/app_list/app_list_constants.h" | 9 #include "ui/app_list/app_list_constants.h" |
| 10 #include "ui/app_list/views/app_list_folder_view.h" | 10 #include "ui/app_list/views/app_list_folder_view.h" |
| 11 #include "ui/app_list/views/apps_container_view.h" | 11 #include "ui/app_list/views/apps_container_view.h" |
| 12 #include "ui/compositor/layer_type.h" |
| 12 #include "ui/compositor/scoped_layer_animation_settings.h" | 13 #include "ui/compositor/scoped_layer_animation_settings.h" |
| 13 #include "ui/gfx/canvas.h" | 14 #include "ui/gfx/canvas.h" |
| 14 #include "ui/gfx/transform_util.h" | 15 #include "ui/gfx/transform_util.h" |
| 15 | 16 |
| 16 namespace app_list { | 17 namespace app_list { |
| 17 | 18 |
| 18 namespace { | 19 namespace { |
| 19 | 20 |
| 20 const float kFolderInkBubbleScale = 1.2f; | 21 const float kFolderInkBubbleScale = 1.2f; |
| 21 const int kBubbleTransitionDurationMs = 200; | 22 const int kBubbleTransitionDurationMs = 200; |
| 22 | 23 |
| 23 } // namespace | 24 } // namespace |
| 24 | 25 |
| 25 FolderBackgroundView::FolderBackgroundView() | 26 FolderBackgroundView::FolderBackgroundView() |
| 26 : folder_view_(NULL), | 27 : folder_view_(NULL), |
| 27 show_state_(NO_BUBBLE) { | 28 show_state_(NO_BUBBLE) { |
| 28 SetPaintToLayer(true); | 29 SetPaintToLayer(ui::LAYER_TEXTURED); |
| 29 layer()->SetFillsBoundsOpaquely(false); | 30 layer()->SetFillsBoundsOpaquely(false); |
| 30 } | 31 } |
| 31 | 32 |
| 32 FolderBackgroundView::~FolderBackgroundView() { | 33 FolderBackgroundView::~FolderBackgroundView() { |
| 33 } | 34 } |
| 34 | 35 |
| 35 void FolderBackgroundView::UpdateFolderContainerBubble(ShowState state) { | 36 void FolderBackgroundView::UpdateFolderContainerBubble(ShowState state) { |
| 36 if (show_state_ == state || | 37 if (show_state_ == state || |
| 37 (state == HIDE_BUBBLE && show_state_ == NO_BUBBLE)) { | 38 (state == HIDE_BUBBLE && show_state_ == NO_BUBBLE)) { |
| 38 return; | 39 return; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 | 91 |
| 91 void FolderBackgroundView::OnImplicitAnimationsCompleted() { | 92 void FolderBackgroundView::OnImplicitAnimationsCompleted() { |
| 92 // Show folder name after the ink bubble disappears. | 93 // Show folder name after the ink bubble disappears. |
| 93 if (show_state_ == HIDE_BUBBLE) { | 94 if (show_state_ == HIDE_BUBBLE) { |
| 94 static_cast<AppsContainerView*>(parent())->app_list_folder_view()-> | 95 static_cast<AppsContainerView*>(parent())->app_list_folder_view()-> |
| 95 UpdateFolderNameVisibility(true); | 96 UpdateFolderNameVisibility(true); |
| 96 } | 97 } |
| 97 } | 98 } |
| 98 | 99 |
| 99 } // namespace app_list | 100 } // namespace app_list |
| OLD | NEW |