| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PANELS_PANEL_RESIZE_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_PANELS_PANEL_RESIZE_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_PANELS_PANEL_RESIZE_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_PANELS_PANEL_RESIZE_CONTROLLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 class PanelResizeController { | 22 class PanelResizeController { |
| 23 public: | 23 public: |
| 24 explicit PanelResizeController(PanelManager* panel_manager); | 24 explicit PanelResizeController(PanelManager* panel_manager); |
| 25 | 25 |
| 26 // Resize the given panel. | 26 // Resize the given panel. |
| 27 // |mouse_location| is in screen coordinate system. | 27 // |mouse_location| is in screen coordinate system. |
| 28 void StartResizing(Panel* panel, | 28 void StartResizing(Panel* panel, |
| 29 const gfx::Point& mouse_location, | 29 const gfx::Point& mouse_location, |
| 30 panel::ResizingSides sides); | 30 panel::ResizingSides sides); |
| 31 void Resize(const gfx::Point& mouse_location); | 31 void Resize(const gfx::Point& mouse_location); |
| 32 void EndResizing(bool cancelled); | 32 |
| 33 // Returns the panel that was resized. |
| 34 Panel* EndResizing(bool cancelled); |
| 33 | 35 |
| 34 // Asynchronous confirmation of panel having been closed. | 36 // Asynchronous confirmation of panel having been closed. |
| 35 void OnPanelClosed(Panel* panel); | 37 void OnPanelClosed(Panel* panel); |
| 36 | 38 |
| 37 bool IsResizing() const { return resizing_panel_ != NULL; } | 39 bool IsResizing() const { return resizing_panel_ != NULL; } |
| 38 | 40 |
| 39 private: | 41 private: |
| 40 PanelManager* panel_manager_; // Weak, owns us. | 42 PanelManager* panel_manager_; // Weak, owns us. |
| 41 | 43 |
| 42 // Panel currently being resized. | 44 // Panel currently being resized. |
| 43 Panel* resizing_panel_; | 45 Panel* resizing_panel_; |
| 44 | 46 |
| 45 // Resizing at which side? | 47 // Resizing at which side? |
| 46 panel::ResizingSides sides_resized_; | 48 panel::ResizingSides sides_resized_; |
| 47 | 49 |
| 48 // The mouse location, in screen coordinates, when StartResizing | 50 // The mouse location, in screen coordinates, when StartResizing |
| 49 // previously called. | 51 // previously called. |
| 50 gfx::Point mouse_location_at_start_; | 52 gfx::Point mouse_location_at_start_; |
| 51 | 53 |
| 52 // Bounds to restore the panel to if resize is cancelled. | 54 // Bounds to restore the panel to if resize is cancelled. |
| 53 gfx::Rect bounds_at_start_; | 55 gfx::Rect bounds_at_start_; |
| 54 | 56 |
| 55 DISALLOW_COPY_AND_ASSIGN(PanelResizeController); | 57 DISALLOW_COPY_AND_ASSIGN(PanelResizeController); |
| 56 }; | 58 }; |
| 57 | 59 |
| 58 #endif // CHROME_BROWSER_UI_PANELS_PANEL_RESIZE_CONTROLLER_H_ | 60 #endif // CHROME_BROWSER_UI_PANELS_PANEL_RESIZE_CONTROLLER_H_ |
| OLD | NEW |