| 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 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 | 7 |
| 8 #include "views/widget/widget_win.h" | 8 #include "views/widget/widget_win.h" |
| 9 #include "views/window/window.h" | 9 #include "views/window/window.h" |
| 10 | 10 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 virtual bool IsActive() const; | 73 virtual bool IsActive() const; |
| 74 virtual bool IsVisible() const; | 74 virtual bool IsVisible() const; |
| 75 virtual bool IsMaximized() const; | 75 virtual bool IsMaximized() const; |
| 76 virtual bool IsMinimized() const; | 76 virtual bool IsMinimized() const; |
| 77 virtual void SetFullscreen(bool fullscreen); | 77 virtual void SetFullscreen(bool fullscreen); |
| 78 virtual bool IsFullscreen() const; | 78 virtual bool IsFullscreen() const; |
| 79 virtual void EnableClose(bool enable); | 79 virtual void EnableClose(bool enable); |
| 80 virtual void DisableInactiveRendering(); | 80 virtual void DisableInactiveRendering(); |
| 81 virtual void UpdateWindowTitle(); | 81 virtual void UpdateWindowTitle(); |
| 82 virtual void UpdateWindowIcon(); | 82 virtual void UpdateWindowIcon(); |
| 83 virtual void SetIsAlwaysOnTop(bool always_on_top); |
| 83 virtual NonClientFrameView* CreateFrameViewForWindow(); | 84 virtual NonClientFrameView* CreateFrameViewForWindow(); |
| 84 virtual void UpdateFrameAfterFrameChange(); | 85 virtual void UpdateFrameAfterFrameChange(); |
| 85 virtual WindowDelegate* GetDelegate() const; | 86 virtual WindowDelegate* GetDelegate() const; |
| 86 virtual NonClientView* GetNonClientView() const; | 87 virtual NonClientView* GetNonClientView() const; |
| 87 virtual ClientView* GetClientView() const; | 88 virtual ClientView* GetClientView() const; |
| 88 virtual gfx::NativeWindow GetNativeWindow() const; | 89 virtual gfx::NativeWindow GetNativeWindow() const; |
| 89 | 90 |
| 90 protected: | 91 protected: |
| 91 friend Window; | 92 friend Window; |
| 92 | 93 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 | 157 |
| 157 // Sets-up the focus manager with the view that should have focus when the | 158 // Sets-up the focus manager with the view that should have focus when the |
| 158 // window is shown the first time. If NULL is returned, the focus goes to the | 159 // window is shown the first time. If NULL is returned, the focus goes to the |
| 159 // button if there is one, otherwise the to the Cancel button. | 160 // button if there is one, otherwise the to the Cancel button. |
| 160 void SetInitialFocus(); | 161 void SetInitialFocus(); |
| 161 | 162 |
| 162 // Place and size the window when it is created. |create_bounds| are the | 163 // Place and size the window when it is created. |create_bounds| are the |
| 163 // bounds used when the window was created. | 164 // bounds used when the window was created. |
| 164 void SetInitialBounds(const gfx::Rect& create_bounds); | 165 void SetInitialBounds(const gfx::Rect& create_bounds); |
| 165 | 166 |
| 166 // Restore saved always on stop state and add the always on top system menu | |
| 167 // if needed. | |
| 168 void InitAlwaysOnTopState(); | |
| 169 | |
| 170 // Add an item for "Always on Top" to the System Menu. | |
| 171 void AddAlwaysOnTopSystemMenuItem(); | |
| 172 | |
| 173 // If necessary, enables all ancestors. | 167 // If necessary, enables all ancestors. |
| 174 void RestoreEnabledIfNecessary(); | 168 void RestoreEnabledIfNecessary(); |
| 175 | 169 |
| 176 // Update the window style to reflect the always on top state. | |
| 177 void AlwaysOnTopChanged(); | |
| 178 | |
| 179 // Calculate the appropriate window styles for this window. | 170 // Calculate the appropriate window styles for this window. |
| 180 DWORD CalculateWindowStyle(); | 171 DWORD CalculateWindowStyle(); |
| 181 DWORD CalculateWindowExStyle(); | 172 DWORD CalculateWindowExStyle(); |
| 182 | 173 |
| 183 // Asks the delegate if any to save the window's location and size. | 174 // Asks the delegate if any to save the window's location and size. |
| 184 void SaveWindowPosition(); | 175 void SaveWindowPosition(); |
| 185 | 176 |
| 186 // Lock or unlock the window from being able to redraw itself in response to | 177 // Lock or unlock the window from being able to redraw itself in response to |
| 187 // updates to its invalid region. | 178 // updates to its invalid region. |
| 188 class ScopedRedrawLock; | 179 class ScopedRedrawLock; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 | 229 |
| 239 // Whether or not the window is modal. This comes from the delegate and is | 230 // Whether or not the window is modal. This comes from the delegate and is |
| 240 // cached at Init time to avoid calling back to the delegate from the | 231 // cached at Init time to avoid calling back to the delegate from the |
| 241 // destructor. | 232 // destructor. |
| 242 bool is_modal_; | 233 bool is_modal_; |
| 243 | 234 |
| 244 // Whether all ancestors have been enabled. This is only used if is_modal_ is | 235 // Whether all ancestors have been enabled. This is only used if is_modal_ is |
| 245 // true. | 236 // true. |
| 246 bool restored_enabled_; | 237 bool restored_enabled_; |
| 247 | 238 |
| 248 // Whether the window is currently always on top. | |
| 249 bool is_always_on_top_; | |
| 250 | |
| 251 // We need to own the text of the menu, the Windows API does not copy it. | |
| 252 std::wstring always_on_top_menu_text_; | |
| 253 | |
| 254 // True if we're in fullscreen mode. | 239 // True if we're in fullscreen mode. |
| 255 bool fullscreen_; | 240 bool fullscreen_; |
| 256 | 241 |
| 257 // Saved window information from before entering fullscreen mode. | 242 // Saved window information from before entering fullscreen mode. |
| 258 SavedWindowInfo saved_window_info_; | 243 SavedWindowInfo saved_window_info_; |
| 259 | 244 |
| 260 // Set to true if the window is in the process of closing . | 245 // Set to true if the window is in the process of closing . |
| 261 bool window_closed_; | 246 bool window_closed_; |
| 262 | 247 |
| 263 // True when the window should be rendered as active, regardless of whether | 248 // True when the window should be rendered as active, regardless of whether |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 // used to catch updates to the rect and work area and react accordingly. | 281 // used to catch updates to the rect and work area and react accordingly. |
| 297 HMONITOR last_monitor_; | 282 HMONITOR last_monitor_; |
| 298 gfx::Rect last_monitor_rect_, last_work_area_; | 283 gfx::Rect last_monitor_rect_, last_work_area_; |
| 299 | 284 |
| 300 DISALLOW_COPY_AND_ASSIGN(WindowWin); | 285 DISALLOW_COPY_AND_ASSIGN(WindowWin); |
| 301 }; | 286 }; |
| 302 | 287 |
| 303 } // namespace views | 288 } // namespace views |
| 304 | 289 |
| 305 #endif // VIEWS_WINDOW_WINDOW_WIN_H_ | 290 #endif // VIEWS_WINDOW_WINDOW_WIN_H_ |
| OLD | NEW |