OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 CHROME_BROWSER_UI_VIEWS_PANELS_PANEL_STACK_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_PANELS_PANEL_STACK_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_PANELS_PANEL_STACK_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_PANELS_PANEL_STACK_VIEW_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 // to make all panels appear as a single window on the taskbar or launcher. | 31 // to make all panels appear as a single window on the taskbar or launcher. |
32 class PanelStackView : public NativePanelStackWindow, | 32 class PanelStackView : public NativePanelStackWindow, |
33 public views::WidgetFocusChangeListener, | 33 public views::WidgetFocusChangeListener, |
34 #if defined(OS_WIN) | 34 #if defined(OS_WIN) |
35 public ui::HWNDMessageFilter, | 35 public ui::HWNDMessageFilter, |
36 public TaskbarWindowThumbnailerDelegateWin, | 36 public TaskbarWindowThumbnailerDelegateWin, |
37 #endif | 37 #endif |
38 public gfx::AnimationDelegate { | 38 public gfx::AnimationDelegate { |
39 public: | 39 public: |
40 explicit PanelStackView(NativePanelStackWindowDelegate* delegate); | 40 explicit PanelStackView(NativePanelStackWindowDelegate* delegate); |
41 virtual ~PanelStackView(); | 41 ~PanelStackView() override; |
42 | 42 |
43 protected: | 43 protected: |
44 // Overridden from NativePanelStackWindow: | 44 // Overridden from NativePanelStackWindow: |
45 virtual void Close() override; | 45 void Close() override; |
46 virtual void AddPanel(Panel* panel) override; | 46 void AddPanel(Panel* panel) override; |
47 virtual void RemovePanel(Panel* panel) override; | 47 void RemovePanel(Panel* panel) override; |
48 virtual void MergeWith(NativePanelStackWindow* another) override; | 48 void MergeWith(NativePanelStackWindow* another) override; |
49 virtual bool IsEmpty() const override; | 49 bool IsEmpty() const override; |
50 virtual bool HasPanel(Panel* panel) const override; | 50 bool HasPanel(Panel* panel) const override; |
51 virtual void MovePanelsBy(const gfx::Vector2d& delta) override; | 51 void MovePanelsBy(const gfx::Vector2d& delta) override; |
52 virtual void BeginBatchUpdatePanelBounds(bool animate) override; | 52 void BeginBatchUpdatePanelBounds(bool animate) override; |
53 virtual void AddPanelBoundsForBatchUpdate( | 53 void AddPanelBoundsForBatchUpdate(Panel* panel, |
54 Panel* panel, const gfx::Rect& new_bounds) override; | 54 const gfx::Rect& new_bounds) override; |
55 virtual void EndBatchUpdatePanelBounds() override; | 55 void EndBatchUpdatePanelBounds() override; |
56 virtual bool IsAnimatingPanelBounds() const override; | 56 bool IsAnimatingPanelBounds() const override; |
57 virtual void Minimize() override; | 57 void Minimize() override; |
58 virtual bool IsMinimized() const override; | 58 bool IsMinimized() const override; |
59 virtual void DrawSystemAttention(bool draw_attention) override; | 59 void DrawSystemAttention(bool draw_attention) override; |
60 virtual void OnPanelActivated(Panel* panel) override; | 60 void OnPanelActivated(Panel* panel) override; |
61 | 61 |
62 private: | 62 private: |
63 typedef std::list<Panel*> Panels; | 63 typedef std::list<Panel*> Panels; |
64 | 64 |
65 // The map value is old bounds of the panel. | 65 // The map value is old bounds of the panel. |
66 typedef std::map<Panel*, gfx::Rect> BoundsUpdates; | 66 typedef std::map<Panel*, gfx::Rect> BoundsUpdates; |
67 | 67 |
68 // Overridden from views::WidgetFocusChangeListener: | 68 // Overridden from views::WidgetFocusChangeListener: |
69 virtual void OnNativeFocusChange(gfx::NativeView focused_before, | 69 void OnNativeFocusChange(gfx::NativeView focused_before, |
70 gfx::NativeView focused_now) override; | 70 gfx::NativeView focused_now) override; |
71 | 71 |
72 // Overridden from AnimationDelegate: | 72 // Overridden from AnimationDelegate: |
73 virtual void AnimationEnded(const gfx::Animation* animation) override; | 73 void AnimationEnded(const gfx::Animation* animation) override; |
74 virtual void AnimationProgressed(const gfx::Animation* animation) override; | 74 void AnimationProgressed(const gfx::Animation* animation) override; |
75 virtual void AnimationCanceled(const gfx::Animation* animation) override; | 75 void AnimationCanceled(const gfx::Animation* animation) override; |
76 | 76 |
77 // Updates the bounds of panels as specified in batch update data. | 77 // Updates the bounds of panels as specified in batch update data. |
78 void UpdatePanelsBounds(); | 78 void UpdatePanelsBounds(); |
79 | 79 |
80 // Notifies the delegate that the updates of the panel bounds are completed. | 80 // Notifies the delegate that the updates of the panel bounds are completed. |
81 void NotifyBoundsUpdateCompleted(); | 81 void NotifyBoundsUpdateCompleted(); |
82 | 82 |
83 // Computes/updates the minimum bounds that could fit all panels. | 83 // Computes/updates the minimum bounds that could fit all panels. |
84 gfx::Rect GetStackWindowBounds() const; | 84 gfx::Rect GetStackWindowBounds() const; |
85 void UpdateStackWindowBounds(); | 85 void UpdateStackWindowBounds(); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 bool bounds_updates_started_; | 137 bool bounds_updates_started_; |
138 BoundsUpdates bounds_updates_; | 138 BoundsUpdates bounds_updates_; |
139 | 139 |
140 // Used to animate the bounds changes at a synchronized pace. | 140 // Used to animate the bounds changes at a synchronized pace. |
141 scoped_ptr<gfx::LinearAnimation> bounds_animator_; | 141 scoped_ptr<gfx::LinearAnimation> bounds_animator_; |
142 | 142 |
143 DISALLOW_COPY_AND_ASSIGN(PanelStackView); | 143 DISALLOW_COPY_AND_ASSIGN(PanelStackView); |
144 }; | 144 }; |
145 | 145 |
146 #endif // CHROME_BROWSER_UI_VIEWS_PANELS_PANEL_STACK_VIEW_H_ | 146 #endif // CHROME_BROWSER_UI_VIEWS_PANELS_PANEL_STACK_VIEW_H_ |
OLD | NEW |