| 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 #ifndef UI_APP_LIST_VIEWS_TOP_ICON_ANIMATION_VIEW_H_ | 5 #ifndef UI_APP_LIST_VIEWS_TOP_ICON_ANIMATION_VIEW_H_ |
| 6 #define UI_APP_LIST_VIEWS_TOP_ICON_ANIMATION_VIEW_H_ | 6 #define UI_APP_LIST_VIEWS_TOP_ICON_ANIMATION_VIEW_H_ |
| 7 | 7 |
| 8 #include "base/observer_list.h" | 8 #include "base/observer_list.h" |
| 9 #include "ui/compositor/layer_animation_observer.h" | 9 #include "ui/compositor/layer_animation_observer.h" |
| 10 #include "ui/views/view.h" | 10 #include "ui/views/view.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 void RemoveObserver(TopIconAnimationObserver* observer); | 47 void RemoveObserver(TopIconAnimationObserver* observer); |
| 48 | 48 |
| 49 // When opening a folder, transform the top item icon from the small icon | 49 // When opening a folder, transform the top item icon from the small icon |
| 50 // inside folder icon to the full scale icon at the target location. | 50 // inside folder icon to the full scale icon at the target location. |
| 51 // When closing a folder, transform the full scale item icon from its | 51 // When closing a folder, transform the full scale item icon from its |
| 52 // location to the small icon inside the folder icon. | 52 // location to the small icon inside the folder icon. |
| 53 void TransformView(); | 53 void TransformView(); |
| 54 | 54 |
| 55 private: | 55 private: |
| 56 // views::View overrides: | 56 // views::View overrides: |
| 57 virtual gfx::Size GetPreferredSize() OVERRIDE; | 57 virtual gfx::Size GetPreferredSize() const OVERRIDE; |
| 58 virtual void Layout() OVERRIDE; | 58 virtual void Layout() OVERRIDE; |
| 59 | 59 |
| 60 // ui::ImplicitAnimationObserver overrides: | 60 // ui::ImplicitAnimationObserver overrides: |
| 61 virtual void OnImplicitAnimationsCompleted() OVERRIDE; | 61 virtual void OnImplicitAnimationsCompleted() OVERRIDE; |
| 62 virtual bool RequiresNotificationWhenAnimatorDestroyed() const OVERRIDE; | 62 virtual bool RequiresNotificationWhenAnimatorDestroyed() const OVERRIDE; |
| 63 | 63 |
| 64 gfx::Size icon_size_; | 64 gfx::Size icon_size_; |
| 65 views::ImageView* icon_; // Owned by views hierarchy. | 65 views::ImageView* icon_; // Owned by views hierarchy. |
| 66 // Rect of the scaled down top item icon inside folder icon's ink bubble. | 66 // Rect of the scaled down top item icon inside folder icon's ink bubble. |
| 67 gfx::Rect scaled_rect_; | 67 gfx::Rect scaled_rect_; |
| 68 // true: opening folder; false: closing folder. | 68 // true: opening folder; false: closing folder. |
| 69 bool open_folder_; | 69 bool open_folder_; |
| 70 | 70 |
| 71 ObserverList<TopIconAnimationObserver> observers_; | 71 ObserverList<TopIconAnimationObserver> observers_; |
| 72 | 72 |
| 73 DISALLOW_COPY_AND_ASSIGN(TopIconAnimationView); | 73 DISALLOW_COPY_AND_ASSIGN(TopIconAnimationView); |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 } // namespace app_list | 76 } // namespace app_list |
| 77 | 77 |
| 78 #endif // UI_APP_LIST_VIEWS_TOP_ICON_ANIMATION_VIEW_H_ | 78 #endif // UI_APP_LIST_VIEWS_TOP_ICON_ANIMATION_VIEW_H_ |
| OLD | NEW |