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

Side by Side Diff: ui/aura_shell/launcher/launcher_view.h

Issue 8369007: Changes launcher animations to fade before moving. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tweaks Created 9 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_AURA_SHELL_LAUNCHER_VIEW_H_ 5 #ifndef UI_AURA_SHELL_LAUNCHER_VIEW_H_
6 #define UI_AURA_SHELL_LAUNCHER_VIEW_H_ 6 #define UI_AURA_SHELL_LAUNCHER_VIEW_H_
7 #pragma once 7 #pragma once
8 8
9 #include "ui/aura_shell/launcher/launcher_button_host.h" 9 #include "ui/aura_shell/launcher/launcher_button_host.h"
10 #include "ui/aura_shell/launcher/launcher_model_observer.h" 10 #include "ui/aura_shell/launcher/launcher_model_observer.h"
(...skipping 17 matching lines...) Expand all
28 public LauncherModelObserver, 28 public LauncherModelObserver,
29 public views::ButtonListener, 29 public views::ButtonListener,
30 public LauncherButtonHost { 30 public LauncherButtonHost {
31 public: 31 public:
32 explicit LauncherView(LauncherModel* model); 32 explicit LauncherView(LauncherModel* model);
33 virtual ~LauncherView(); 33 virtual ~LauncherView();
34 34
35 void Init(); 35 void Init();
36 36
37 private: 37 private:
38 class FadeOutAnimationDelegate;
39 class StartFadeAnimationDelegate;
40
38 struct IdealBounds { 41 struct IdealBounds {
39 gfx::Rect new_browser_bounds; 42 gfx::Rect new_browser_bounds;
40 gfx::Rect show_apps_bounds; 43 gfx::Rect show_apps_bounds;
41 }; 44 };
42 45
43 // Sets the bounds of each view to its ideal bounds. 46 // Sets the bounds of each view to its ideal bounds.
44 void LayoutToIdealBounds(); 47 void LayoutToIdealBounds();
45 48
46 // Calculates the ideal bounds. The bounds of each button corresponding to an 49 // Calculates the ideal bounds. The bounds of each button corresponding to an
47 // item in the model is set in |view_model_|, the bounds of the 50 // item in the model is set in |view_model_|, the bounds of the
48 // |new_browser_button_| and |show_apps_button_| is set in |bounds|. 51 // |new_browser_button_| and |show_apps_button_| is set in |bounds|.
49 void CalculateIdealBounds(IdealBounds* bounds); 52 void CalculateIdealBounds(IdealBounds* bounds);
50 53
51 // Animates the bounds of each view to its ideal bounds. 54 // Animates the bounds of each view to its ideal bounds.
52 void AnimateToIdealBounds(); 55 void AnimateToIdealBounds();
53 56
54 // Creates the view used to represent |item|. 57 // Creates the view used to represent |item|.
55 views::View* CreateViewForItem(const LauncherItem& item); 58 views::View* CreateViewForItem(const LauncherItem& item);
56 59
57 // Resizes the widget to fit the view. 60 // Fades |view| from an opacity of 0 to 1. This is when adding a new item.
58 void Resize(); 61 void FadeIn(views::View* view);
59 62
60 // Invoked when the mouse has moved enough to trigger a drag. Sets internal 63 // Invoked when the mouse has moved enough to trigger a drag. Sets internal
61 // state in preparation for the drag. 64 // state in preparation for the drag.
62 void PrepareForDrag(const views::MouseEvent& event); 65 void PrepareForDrag(const views::MouseEvent& event);
63 66
64 // Invoked when the mouse is dragged. Updates the models as appropriate. 67 // Invoked when the mouse is dragged. Updates the models as appropriate.
65 void ContinueDrag(const views::MouseEvent& event); 68 void ContinueDrag(const views::MouseEvent& event);
66 69
67 // If there is a drag operation in progress it's canceled. 70 // If there is a drag operation in progress it's canceled.
68 void CancelDrag(views::View* deleted_view); 71 void CancelDrag(views::View* deleted_view);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 // Index |drag_view_| was initially at. 118 // Index |drag_view_| was initially at.
116 int start_drag_index_; 119 int start_drag_index_;
117 120
118 DISALLOW_COPY_AND_ASSIGN(LauncherView); 121 DISALLOW_COPY_AND_ASSIGN(LauncherView);
119 }; 122 };
120 123
121 } // namespace internal 124 } // namespace internal
122 } // namespace aura_shell 125 } // namespace aura_shell
123 126
124 #endif // UI_AURA_SHELL_LAUNCHER_VIEW_H_ 127 #endif // UI_AURA_SHELL_LAUNCHER_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698