diff options
author | beng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-07-31 01:21:01 +0000 |
---|---|---|
committer | beng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-07-31 01:21:01 +0000 |
commit | 1ec87abd0442cd66b55725a9a188ee3182a3c339 (patch) | |
tree | 01809c087899087e9f0111e9d1327eedd62f68db /chrome/views/window.h | |
parent | f3181317c218aceb35bd3324d5c796901b7b657f (diff) | |
download | chromium_src-1ec87abd0442cd66b55725a9a188ee3182a3c339.zip chromium_src-1ec87abd0442cd66b55725a9a188ee3182a3c339.tar.gz chromium_src-1ec87abd0442cd66b55725a9a188ee3182a3c339.tar.bz2 |
Move some methods from public to protected, since only subclasses should be calling them.
Move some data members from protected to private and provide a protected setter, per C++ style guidelines.
B=1293984
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@157 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/views/window.h')
-rw-r--r-- | chrome/views/window.h | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/chrome/views/window.h b/chrome/views/window.h index 534634c..a941cb2 100644 --- a/chrome/views/window.h +++ b/chrome/views/window.h @@ -56,14 +56,6 @@ class WindowDelegate; //////////////////////////////////////////////////////////////////////////////// class Window : public HWNDViewContainer { public: - // TODO(beng): (Cleanup) move these into private section, effectively making - // this class "final" to all but designated friends within - // ChromeViews. Users in browser/ should always construct with - // CreateChromeWindow which will give the right version, - // depending on platform & configuration. - // Create a Window using the specified delegate. The delegate must not be - // NULL. - explicit Window(WindowDelegate* window_delegate); virtual ~Window(); // Creates the appropriate Window class for a Chrome dialog or window. This @@ -72,12 +64,6 @@ class Window : public HWNDViewContainer { const gfx::Rect& bounds, WindowDelegate* window_delegate); - // Create the Window. - // If parent is NULL, this Window is top level on the desktop. - // If |bounds| is empty, the view is queried for its preferred size and - // centered on screen. - virtual void Init(HWND parent, const gfx::Rect& bounds); - // Return the size of window (including non-client area) required to contain // a window of the specified client size. virtual gfx::Size CalculateWindowSizeForClientSize( @@ -155,6 +141,15 @@ class Window : public HWNDViewContainer { int row_resource_id); protected: + // Constructs the Window. |window_delegate| cannot be NULL. + explicit Window(WindowDelegate* window_delegate); + + // Create the Window. + // If parent is NULL, this Window is top level on the desktop. + // If |bounds| is empty, the view is queried for its preferred size and + // centered on screen. + virtual void Init(HWND parent, const gfx::Rect& bounds); + // Sets the specified view as the ClientView of this Window. The ClientView // is responsible for laying out the Window's contents view, as well as // performing basic hit-testing, and perhaps other responsibilities depending @@ -167,6 +162,8 @@ class Window : public HWNDViewContainer { // Sizes the window to the default size specified by its ClientView. virtual void SizeWindowToDefault(); + void set_client_view(ClientView* client_view) { client_view_ = client_view; } + // Overridden from HWNDViewContainer: virtual void OnActivate(UINT action, BOOL minimized, HWND window); virtual void OnCommand(UINT notification_code, int command_id, HWND window); @@ -177,14 +174,6 @@ class Window : public HWNDViewContainer { virtual void OnSize(UINT size_param, const CSize& new_size); virtual void OnSysCommand(UINT notification_code, CPoint click); - // A ClientView object or subclass, responsible for sizing the contents view - // of the window, hit testing and perhaps other tasks depending on the - // implementation. - ClientView* client_view_; - - // Our window delegate (see Init method for documentation). - WindowDelegate* window_delegate_; - private: // Set the window as modal (by disabling all the other windows). void BecomeModal(); @@ -218,6 +207,14 @@ class Window : public HWNDViewContainer { static void InitClass(); static HCURSOR nwse_cursor_; + // A ClientView object or subclass, responsible for sizing the contents view + // of the window, hit testing and perhaps other tasks depending on the + // implementation. + ClientView* client_view_; + + // Our window delegate (see Init method for documentation). + WindowDelegate* window_delegate_; + // Whether we should SetFocus() on a newly created window after // Init(). Defaults to true. bool focus_on_creation_; |