| 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 24 matching lines...) Expand all Loading... |
| 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 virtual ~PanelStackView(); |
| 42 | 42 |
| 43 protected: | 43 protected: |
| 44 // Overridden from NativePanelStackWindow: | 44 // Overridden from NativePanelStackWindow: |
| 45 virtual void Close() OVERRIDE; | 45 virtual void Close() override; |
| 46 virtual void AddPanel(Panel* panel) OVERRIDE; | 46 virtual void AddPanel(Panel* panel) override; |
| 47 virtual void RemovePanel(Panel* panel) OVERRIDE; | 47 virtual void RemovePanel(Panel* panel) override; |
| 48 virtual void MergeWith(NativePanelStackWindow* another) OVERRIDE; | 48 virtual void MergeWith(NativePanelStackWindow* another) override; |
| 49 virtual bool IsEmpty() const OVERRIDE; | 49 virtual bool IsEmpty() const override; |
| 50 virtual bool HasPanel(Panel* panel) const OVERRIDE; | 50 virtual bool HasPanel(Panel* panel) const override; |
| 51 virtual void MovePanelsBy(const gfx::Vector2d& delta) OVERRIDE; | 51 virtual void MovePanelsBy(const gfx::Vector2d& delta) override; |
| 52 virtual void BeginBatchUpdatePanelBounds(bool animate) OVERRIDE; | 52 virtual void BeginBatchUpdatePanelBounds(bool animate) override; |
| 53 virtual void AddPanelBoundsForBatchUpdate( | 53 virtual void AddPanelBoundsForBatchUpdate( |
| 54 Panel* panel, const gfx::Rect& new_bounds) OVERRIDE; | 54 Panel* panel, const gfx::Rect& new_bounds) override; |
| 55 virtual void EndBatchUpdatePanelBounds() OVERRIDE; | 55 virtual void EndBatchUpdatePanelBounds() override; |
| 56 virtual bool IsAnimatingPanelBounds() const OVERRIDE; | 56 virtual bool IsAnimatingPanelBounds() const override; |
| 57 virtual void Minimize() OVERRIDE; | 57 virtual void Minimize() override; |
| 58 virtual bool IsMinimized() const OVERRIDE; | 58 virtual bool IsMinimized() const override; |
| 59 virtual void DrawSystemAttention(bool draw_attention) OVERRIDE; | 59 virtual void DrawSystemAttention(bool draw_attention) override; |
| 60 virtual void OnPanelActivated(Panel* panel) OVERRIDE; | 60 virtual 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 virtual 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 virtual void AnimationEnded(const gfx::Animation* animation) override; |
| 74 virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE; | 74 virtual void AnimationProgressed(const gfx::Animation* animation) override; |
| 75 virtual void AnimationCanceled(const gfx::Animation* animation) OVERRIDE; | 75 virtual 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(); |
| 86 | 86 |
| 87 views::Widget* CreateWindowWithBounds(const gfx::Rect& bounds); | 87 views::Widget* CreateWindowWithBounds(const gfx::Rect& bounds); |
| 88 void EnsureWindowCreated(); | 88 void EnsureWindowCreated(); |
| 89 | 89 |
| 90 // Makes the stack window own the panel window such that multiple panels | 90 // Makes the stack window own the panel window such that multiple panels |
| 91 // stacked together could appear as a single window on the taskbar or | 91 // stacked together could appear as a single window on the taskbar or |
| 92 // launcher. | 92 // launcher. |
| 93 static void MakeStackWindowOwnPanelWindow(Panel* panel, | 93 static void MakeStackWindowOwnPanelWindow(Panel* panel, |
| 94 PanelStackView* stack_window); | 94 PanelStackView* stack_window); |
| 95 | 95 |
| 96 #if defined(OS_WIN) | 96 #if defined(OS_WIN) |
| 97 // Overridden from ui::HWNDMessageFilter: | 97 // Overridden from ui::HWNDMessageFilter: |
| 98 virtual bool FilterMessage(HWND hwnd, | 98 virtual bool FilterMessage(HWND hwnd, |
| 99 UINT message, | 99 UINT message, |
| 100 WPARAM w_param, | 100 WPARAM w_param, |
| 101 LPARAM l_param, | 101 LPARAM l_param, |
| 102 LRESULT* l_result) OVERRIDE; | 102 LRESULT* l_result) override; |
| 103 | 103 |
| 104 // Overridden from TaskbarWindowThumbnailerDelegateWin: | 104 // Overridden from TaskbarWindowThumbnailerDelegateWin: |
| 105 virtual std::vector<HWND> GetSnapshotWindowHandles() const OVERRIDE; | 105 virtual std::vector<HWND> GetSnapshotWindowHandles() const override; |
| 106 | 106 |
| 107 // Updates the live preview snapshot when something changes, like | 107 // Updates the live preview snapshot when something changes, like |
| 108 // adding/removing/moving/resizing a stacked panel. | 108 // adding/removing/moving/resizing a stacked panel. |
| 109 void RefreshLivePreviewThumbnail(); | 109 void RefreshLivePreviewThumbnail(); |
| 110 | 110 |
| 111 // Updates the bounds of the widget window in a deferred way. | 111 // Updates the bounds of the widget window in a deferred way. |
| 112 void DeferUpdateNativeWindowBounds(HDWP defer_window_pos_info, | 112 void DeferUpdateNativeWindowBounds(HDWP defer_window_pos_info, |
| 113 views::Widget* window, | 113 views::Widget* window, |
| 114 const gfx::Rect& bounds); | 114 const gfx::Rect& bounds); |
| 115 #endif | 115 #endif |
| (...skipping 21 matching lines...) Expand all 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 |