diff options
author | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-20 23:07:41 +0000 |
---|---|---|
committer | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-20 23:07:41 +0000 |
commit | 5e49546581a5a4c2c02d718f9d6e3dbebd7bebc7 (patch) | |
tree | 2a908845ceef1a7df68ff47eed5f2bd54d12cc9e /chrome/browser/views/tabs/dragged_tab_controller.h | |
parent | dcda464d91fb97423f5b551babffe786b24ee251 (diff) | |
download | chromium_src-5e49546581a5a4c2c02d718f9d6e3dbebd7bebc7.zip chromium_src-5e49546581a5a4c2c02d718f9d6e3dbebd7bebc7.tar.gz chromium_src-5e49546581a5a4c2c02d718f9d6e3dbebd7bebc7.tar.bz2 |
Adds various docking positions when dragging around a tab. I've added
the ability to dock to the following locations:
Maximize the window on drop.
Resize the window to fill up the left, bottom, or right half of the
monitor.
Tile the newly created window with an existing chrome window such that
the two are on top of each other and fill the height of the monitor,
or tiled such that they fill the width of the monitor.
The graphics suxor. Glen says he'll come up with something better once
its landed.
BUG=none
TEST=4628
Review URL: http://codereview.chromium.org/11325
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5797 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/tabs/dragged_tab_controller.h')
-rw-r--r-- | chrome/browser/views/tabs/dragged_tab_controller.h | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/chrome/browser/views/tabs/dragged_tab_controller.h b/chrome/browser/views/tabs/dragged_tab_controller.h index fb367c3..0363d93 100644 --- a/chrome/browser/views/tabs/dragged_tab_controller.h +++ b/chrome/browser/views/tabs/dragged_tab_controller.h @@ -7,7 +7,9 @@ #include "base/gfx/rect.h" #include "base/message_loop.h" +#include "chrome/browser/dock_info.h" #include "chrome/browser/tab_contents_delegate.h" +#include "chrome/browser/tabs/tab_strip_model.h" #include "chrome/browser/views/tabs/tab_renderer.h" #include "chrome/common/notification_service.h" @@ -15,6 +17,7 @@ namespace views { class MouseEvent; class View; } +class BrowserWindow; class DraggedTabView; class HWNDPhotobooth; class SkBitmap; @@ -65,6 +68,9 @@ class DraggedTabController : public TabContentsDelegate, bool IsDragSourceTab(Tab* tab) const; private: + class DockDisplayer; + friend class DockDisplayer; + // Enumeration of the ways a drag session can end. enum EndDragType { // Drag session exited normally: the user released the mouse. @@ -118,6 +124,8 @@ class DraggedTabController : public TabContentsDelegate, // current mouse position. gfx::Point GetWindowCreatePoint() const; + void UpdateDockInfo(const gfx::Point& screen_point); + // Replaces the TabContents being dragged with the specified |new_contents|. // This can occur if the active TabContents for the tab being dragged is // replaced, e.g. if a transition from one TabContentsType to another occurs @@ -145,7 +153,9 @@ class DraggedTabController : public TabContentsDelegate, // Returns the compatible TabStrip that is under the specified point (screen // coordinates), or NULL if there is none. - TabStrip* GetTabStripForPoint(const gfx::Point& screen_point) const; + TabStrip* GetTabStripForPoint(const gfx::Point& screen_point); + + DockInfo GetDockInfoAtPoint(const gfx::Point& screen_point); // Returns the specified |tabstrip| if it contains the specified point // (screen coordinates), NULL if it does not. @@ -213,6 +223,8 @@ class DraggedTabController : public TabContentsDelegate, // position. void OnAnimateToBoundsComplete(); + void DockDisplayerDestroyed(DockDisplayer* controller); + // The TabContents being dragged. This can get replaced during the drag if // the associated NavigationController is navigated to a different // TabContentsType. @@ -279,8 +291,12 @@ class DraggedTabController : public TabContentsDelegate, // time of the last re-order event. int last_move_screen_x_; + DockInfo dock_info_; + + std::set<HWND> dock_windows_; + std::vector<DockDisplayer*> dock_controllers_; + DISALLOW_COPY_AND_ASSIGN(DraggedTabController); }; #endif // CHROME_BROWSER_VIEWS_TABS_DRAGGED_TAB_CONTROLLER_H_ - |