diff options
Diffstat (limited to 'chrome/browser/dock_info.h')
-rw-r--r-- | chrome/browser/dock_info.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/chrome/browser/dock_info.h b/chrome/browser/dock_info.h index dd94563..0774e6b 100644 --- a/chrome/browser/dock_info.h +++ b/chrome/browser/dock_info.h @@ -25,6 +25,15 @@ class Profile; // DockInfos are cheap and explicitly allow copy and assignment operators. class DockInfo { public: + class Factory { + public: + virtual DockInfo GetDockInfoAtPoint(const gfx::Point& screen_point, + const std::set<HWND>& ignore) = 0; + + virtual HWND GetLocalProcessWindowAtPoint(const gfx::Point& screen_point, + const std::set<HWND>& ignore) = 0; + }; + // Possible dock positions. enum Type { // Indicates there is no valid dock position for the current location. @@ -48,6 +57,9 @@ class DockInfo { DockInfo() : type_(NONE), hwnd_(NULL), in_enable_area_(false) {} + // Sets the factory. + static void set_factory(Factory* factory) { factory_ = factory; } + // Size of the popup window shown to indicate a valid dock location. static int popup_width(); static int popup_height(); @@ -58,6 +70,9 @@ class DockInfo { // // If there is no docking position for the specified location the returned // DockInfo has a type of NONE. + // + // If a Factory has been set, the method of the same name is invoked on the + // Factory to determine the DockInfo. static DockInfo GetDockInfoAtPoint(const gfx::Point& screen_point, const std::set<HWND>& ignore); @@ -65,6 +80,9 @@ class DockInfo { // See GetDockInfoAtPoint for a description of |ignore|. This returns NULL if // there is no window from the current process at |screen_point|, or another // window obscures the topmost window from our process at |screen_point|. + // + // If a Factory has been set, the method of the same name is invoked on the + // Factory to determine the DockInfo. static HWND GetLocalProcessWindowAtPoint(const gfx::Point& screen_point, const std::set<HWND>& ignore); @@ -139,6 +157,10 @@ class DockInfo { gfx::Point hot_spot_; gfx::Rect monitor_bounds_; bool in_enable_area_; + + // Factory that creates DockInfos. By default this is NULL, which gives the + // default behavior. + static Factory* factory_; }; #endif // CHROME_BROWSER_DOCK_INFO_H_ |