diff options
author | beng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-07-30 22:30:22 +0000 |
---|---|---|
committer | beng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-07-30 22:30:22 +0000 |
commit | cb5d17f2f5c9d4a9777439f58e4a7f6eb049e26f (patch) | |
tree | 8124412fcae98e1e465668bc66a2f97d9fe7b3a4 /chrome/views/custom_frame_window.h | |
parent | e3dad87db7cab48a8a1109a49fd1119fd98ff6da (diff) | |
download | chromium_src-cb5d17f2f5c9d4a9777439f58e4a7f6eb049e26f.zip chromium_src-cb5d17f2f5c9d4a9777439f58e4a7f6eb049e26f.tar.gz chromium_src-cb5d17f2f5c9d4a9777439f58e4a7f6eb049e26f.tar.bz2 |
Make NonClientView an interface independent of CustomFrameWindow (i.e. move it into its own file).
Rename NonClientView's HitTest method to NonClientHitTest, so it doesn't collide with View's HitTest method.
Also, consolidate some duplicated code between CustomFrameWindow and ConstrainedWindow's non-client view impl.
B=1300864
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/views/custom_frame_window.h')
-rw-r--r-- | chrome/views/custom_frame_window.h | 40 |
1 files changed, 5 insertions, 35 deletions
diff --git a/chrome/views/custom_frame_window.h b/chrome/views/custom_frame_window.h index 52356b2..72c7c1c 100644 --- a/chrome/views/custom_frame_window.h +++ b/chrome/views/custom_frame_window.h @@ -36,6 +36,8 @@ namespace ChromeViews { +class NonClientView; + //////////////////////////////////////////////////////////////////////////////// // // CustomFrameWindow @@ -49,7 +51,6 @@ namespace ChromeViews { class CustomFrameWindow : public Window { public: explicit CustomFrameWindow(WindowDelegate* window_delegate); - class NonClientView; CustomFrameWindow(WindowDelegate* window_delegate, NonClientView* non_client_view); virtual ~CustomFrameWindow(); @@ -67,38 +68,6 @@ class CustomFrameWindow : public Window { // Returns whether or not the frame is active. bool is_active() const { return is_active_; } - class NonClientView : public View { - public: - virtual void Init(ClientView* client_view) = 0; - - // Calculates the bounds of the client area of the window assuming the - // window is sized to |width| and |height|. - virtual gfx::Rect CalculateClientAreaBounds(int width, - int height) const = 0; - - // Calculates the size of window required to display a client area of the - // specified width and height. - virtual gfx::Size CalculateWindowSizeForClientSize(int width, - int height) const = 0; - - // Returns the point, in screen coordinates, where the system menu should - // be shown so it shows up anchored to the system menu icon. - virtual CPoint GetSystemMenuPoint() const = 0; - - // Determines the windows HT* code when the mouse cursor is at the - // specified point, in window coordinates. - virtual int HitTest(const gfx::Point& point) = 0; - - // Returns a mask to be used to clip the top level window for the given - // size. This is used to create the non-rectangular window shape. - virtual void GetWindowMask(const gfx::Size& size, - gfx::Path* window_mask) = 0; - - // Toggles the enable state for the Close button (and the Close menu item in - // the system menu). - virtual void EnableClose(bool enable) = 0; - }; - // Overridden from Window: virtual gfx::Size CalculateWindowSizeForClientSize( const gfx::Size& client_size) const; @@ -123,11 +92,12 @@ class CustomFrameWindow : public Window { virtual void OnSize(UINT param, const CSize& size); // The View that provides the non-client area of the window (title bar, - // window controls, sizing borders etc). + // window controls, sizing borders etc). To use an implementation other than + // the default, this class must be subclassed and this value set to the + // desired implementation before calling |Init|. NonClientView* non_client_view_; private: - // Shows the system menu at the specified screen point. void RunSystemMenu(const CPoint& point); |