| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_VIEWS_WINDOW_H__ | 5 #ifndef CHROME_VIEWS_WINDOW_H__ |
| 6 #define CHROME_VIEWS_WINDOW_H__ | 6 #define CHROME_VIEWS_WINDOW_H__ |
| 7 | 7 |
| 8 #include "chrome/common/notification_registrar.h" | 8 #include "chrome/common/notification_registrar.h" |
| 9 #include "chrome/views/client_view.h" | 9 #include "chrome/views/client_view.h" |
| 10 #include "chrome/views/non_client_view.h" | 10 #include "chrome/views/non_client_view.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 virtual void UpdateFrameAfterFrameChange(); | 109 virtual void UpdateFrameAfterFrameChange(); |
| 110 | 110 |
| 111 // Accessors and setters for various properties. | 111 // Accessors and setters for various properties. |
| 112 WindowDelegate* window_delegate() const { return window_delegate_; } | 112 WindowDelegate* window_delegate() const { return window_delegate_; } |
| 113 HWND owning_window() const { return owning_hwnd_; } | 113 HWND owning_window() const { return owning_hwnd_; } |
| 114 ClientView* client_view() const { return non_client_view_->client_view(); } | 114 ClientView* client_view() const { return non_client_view_->client_view(); } |
| 115 bool is_active() const { return is_active_; } | 115 bool is_active() const { return is_active_; } |
| 116 void set_focus_on_creation(bool focus_on_creation) { | 116 void set_focus_on_creation(bool focus_on_creation) { |
| 117 focus_on_creation_ = focus_on_creation; | 117 focus_on_creation_ = focus_on_creation; |
| 118 } | 118 } |
| 119 void set_force_hidden(bool force_hidden) { force_hidden_ = force_hidden; } |
| 119 | 120 |
| 120 // Returns the preferred size of the contents view of this window based on | 121 // Returns the preferred size of the contents view of this window based on |
| 121 // its localized size data. The width in cols is held in a localized string | 122 // its localized size data. The width in cols is held in a localized string |
| 122 // resource identified by |col_resource_id|, the height in the same fashion. | 123 // resource identified by |col_resource_id|, the height in the same fashion. |
| 123 // TODO(beng): This should eventually live somewhere else, probably closer to | 124 // TODO(beng): This should eventually live somewhere else, probably closer to |
| 124 // ClientView. | 125 // ClientView. |
| 125 static int GetLocalizedContentsWidth(int col_resource_id); | 126 static int GetLocalizedContentsWidth(int col_resource_id); |
| 126 static int GetLocalizedContentsHeight(int row_resource_id); | 127 static int GetLocalizedContentsHeight(int row_resource_id); |
| 127 static gfx::Size GetLocalizedContentsSize(int col_resource_id, | 128 static gfx::Size GetLocalizedContentsSize(int col_resource_id, |
| 128 int row_resource_id); | 129 int row_resource_id); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 virtual void OnNCPaint(HRGN rgn); | 172 virtual void OnNCPaint(HRGN rgn); |
| 172 virtual void OnNCLButtonDown(UINT ht_component, const CPoint& point); | 173 virtual void OnNCLButtonDown(UINT ht_component, const CPoint& point); |
| 173 virtual void OnNCRButtonDown(UINT ht_component, const CPoint& point); | 174 virtual void OnNCRButtonDown(UINT ht_component, const CPoint& point); |
| 174 virtual LRESULT OnNCUAHDrawCaption(UINT msg, WPARAM w_param, LPARAM l_param); | 175 virtual LRESULT OnNCUAHDrawCaption(UINT msg, WPARAM w_param, LPARAM l_param); |
| 175 virtual LRESULT OnNCUAHDrawFrame(UINT msg, WPARAM w_param, LPARAM l_param); | 176 virtual LRESULT OnNCUAHDrawFrame(UINT msg, WPARAM w_param, LPARAM l_param); |
| 176 virtual LRESULT OnSetCursor(HWND window, UINT hittest_code, UINT message); | 177 virtual LRESULT OnSetCursor(HWND window, UINT hittest_code, UINT message); |
| 177 virtual LRESULT OnSetIcon(UINT size_type, HICON new_icon); | 178 virtual LRESULT OnSetIcon(UINT size_type, HICON new_icon); |
| 178 virtual LRESULT OnSetText(const wchar_t* text); | 179 virtual LRESULT OnSetText(const wchar_t* text); |
| 179 virtual void OnSize(UINT size_param, const CSize& new_size); | 180 virtual void OnSize(UINT size_param, const CSize& new_size); |
| 180 virtual void OnSysCommand(UINT notification_code, CPoint click); | 181 virtual void OnSysCommand(UINT notification_code, CPoint click); |
| 182 virtual void OnWindowPosChanging(WINDOWPOS* window_pos); |
| 181 virtual Window* AsWindow() { return this; } | 183 virtual Window* AsWindow() { return this; } |
| 182 virtual const Window* AsWindow() const { return this; } | 184 virtual const Window* AsWindow() const { return this; } |
| 183 | 185 |
| 184 // The View that provides the non-client area of the window (title bar, | 186 // The View that provides the non-client area of the window (title bar, |
| 185 // window controls, sizing borders etc). To use an implementation other than | 187 // window controls, sizing borders etc). To use an implementation other than |
| 186 // the default, this class must be subclassed and this value set to the | 188 // the default, this class must be subclassed and this value set to the |
| 187 // desired implementation before calling |Init|. | 189 // desired implementation before calling |Init|. |
| 188 NonClientView* non_client_view_; | 190 NonClientView* non_client_view_; |
| 189 | 191 |
| 190 // Accessor for disable_inactive_rendering_. | 192 // Accessor for disable_inactive_rendering_. |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 // True if updates to this window are currently locked. | 299 // True if updates to this window are currently locked. |
| 298 bool lock_updates_; | 300 bool lock_updates_; |
| 299 | 301 |
| 300 // The window styles of the window before updates were locked. | 302 // The window styles of the window before updates were locked. |
| 301 DWORD saved_window_style_; | 303 DWORD saved_window_style_; |
| 302 | 304 |
| 303 // The saved maximized state for this window. See note in SetInitialBounds | 305 // The saved maximized state for this window. See note in SetInitialBounds |
| 304 // that explains why we save this. | 306 // that explains why we save this. |
| 305 bool saved_maximized_state_; | 307 bool saved_maximized_state_; |
| 306 | 308 |
| 309 // True if we should prevent attempts to make the window visible when we |
| 310 // handle WM_WINDOWPOSCHANGING. Some calls like ShowWindow(SW_RESTORE) make |
| 311 // the window visible in addition to restoring it, when all we want to do is |
| 312 // restore it. |
| 313 bool force_hidden_; |
| 314 |
| 307 // Hold onto notifications. | 315 // Hold onto notifications. |
| 308 NotificationRegistrar notification_registrar_; | 316 NotificationRegistrar notification_registrar_; |
| 309 | 317 |
| 310 DISALLOW_COPY_AND_ASSIGN(Window); | 318 DISALLOW_COPY_AND_ASSIGN(Window); |
| 311 }; | 319 }; |
| 312 | 320 |
| 313 } // namespace views | 321 } // namespace views |
| 314 | 322 |
| 315 #endif // CHROME_VIEWS_WINDOW_H__ | 323 #endif // CHROME_VIEWS_WINDOW_H__ |
| OLD | NEW |