| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 VIEWS_WINDOW_WINDOW_WIN_H_ | 5 #ifndef VIEWS_WINDOW_WINDOW_WIN_H_ |
| 6 #define VIEWS_WINDOW_WINDOW_WIN_H_ | 6 #define VIEWS_WINDOW_WINDOW_WIN_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "views/widget/widget_win.h" | 9 #include "views/widget/widget_win.h" |
| 10 #include "views/window/native_window.h" | 10 #include "views/window/native_window.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 65 |
| 66 // Returns the system set window title font. | 66 // Returns the system set window title font. |
| 67 static gfx::Font GetWindowTitleFont(); | 67 static gfx::Font GetWindowTitleFont(); |
| 68 | 68 |
| 69 protected: | 69 protected: |
| 70 friend Window; | 70 friend Window; |
| 71 | 71 |
| 72 // Constructs the WindowWin. |window_delegate| cannot be NULL. | 72 // Constructs the WindowWin. |window_delegate| cannot be NULL. |
| 73 explicit WindowWin(WindowDelegate* window_delegate); | 73 explicit WindowWin(WindowDelegate* window_delegate); |
| 74 | 74 |
| 75 // Create the Window. | |
| 76 // If parent is NULL, this WindowWin is top level on the desktop. | |
| 77 // If |bounds| is empty, the view is queried for its preferred size and | |
| 78 // centered on screen. | |
| 79 virtual void Init(gfx::NativeView parent, const gfx::Rect& bounds) OVERRIDE; | |
| 80 | |
| 81 // Returns the insets of the client area relative to the non-client area of | 75 // Returns the insets of the client area relative to the non-client area of |
| 82 // the window. Override this function instead of OnNCCalcSize, which is | 76 // the window. Override this function instead of OnNCCalcSize, which is |
| 83 // crazily complicated. | 77 // crazily complicated. |
| 84 virtual gfx::Insets GetClientAreaInsets() const; | 78 virtual gfx::Insets GetClientAreaInsets() const; |
| 85 | 79 |
| 86 // Retrieve the show state of the window. This is one of the SW_SHOW* flags | 80 // Retrieve the show state of the window. This is one of the SW_SHOW* flags |
| 87 // passed into Windows' ShowWindow method. For normal windows this defaults | 81 // passed into Windows' ShowWindow method. For normal windows this defaults |
| 88 // to SW_SHOWNORMAL, however windows (e.g. the main window) can override this | 82 // to SW_SHOWNORMAL, however windows (e.g. the main window) can override this |
| 89 // method to provide different values (e.g. retrieve the user's specified | 83 // method to provide different values (e.g. retrieve the user's specified |
| 90 // show state from the shortcut starutp info). | 84 // show state from the shortcut starutp info). |
| 91 virtual int GetShowState() const; | 85 virtual int GetShowState() const; |
| 92 | 86 |
| 93 // Overridden from WidgetWin: | 87 // Overridden from WidgetWin: |
| 88 virtual void InitNativeWidget(const Widget::CreateParams& params) OVERRIDE; |
| 94 virtual void OnActivateApp(BOOL active, DWORD thread_id) OVERRIDE; | 89 virtual void OnActivateApp(BOOL active, DWORD thread_id) OVERRIDE; |
| 95 virtual LRESULT OnAppCommand(HWND window, | 90 virtual LRESULT OnAppCommand(HWND window, |
| 96 short app_command, | 91 short app_command, |
| 97 WORD device, | 92 WORD device, |
| 98 int keystate) OVERRIDE; | 93 int keystate) OVERRIDE; |
| 99 virtual void OnClose() OVERRIDE; | 94 virtual void OnClose() OVERRIDE; |
| 100 virtual void OnCommand(UINT notification_code, | 95 virtual void OnCommand(UINT notification_code, |
| 101 int command_id, | 96 int command_id, |
| 102 HWND window) OVERRIDE; | 97 HWND window) OVERRIDE; |
| 103 virtual void OnDestroy() OVERRIDE; | 98 virtual void OnDestroy() OVERRIDE; |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 | 276 |
| 282 // True when the window is being moved/sized. | 277 // True when the window is being moved/sized. |
| 283 bool is_in_size_move_; | 278 bool is_in_size_move_; |
| 284 | 279 |
| 285 DISALLOW_COPY_AND_ASSIGN(WindowWin); | 280 DISALLOW_COPY_AND_ASSIGN(WindowWin); |
| 286 }; | 281 }; |
| 287 | 282 |
| 288 } // namespace views | 283 } // namespace views |
| 289 | 284 |
| 290 #endif // VIEWS_WINDOW_WINDOW_WIN_H_ | 285 #endif // VIEWS_WINDOW_WINDOW_WIN_H_ |
| OLD | NEW |