OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 UI_VIEWS_WIDGET_NATIVE_WIDGET_WIN_H_ | 5 #ifndef UI_VIEWS_WIDGET_NATIVE_WIDGET_WIN_H_ |
6 #define UI_VIEWS_WIDGET_NATIVE_WIDGET_WIN_H_ | 6 #define UI_VIEWS_WIDGET_NATIVE_WIDGET_WIN_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <atlbase.h> | 9 #include <atlbase.h> |
10 #include <atlapp.h> | 10 #include <atlapp.h> |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
108 | 108 |
109 // Hides the window if it hasn't already been force-hidden. The force hidden | 109 // Hides the window if it hasn't already been force-hidden. The force hidden |
110 // count is tracked, so calling multiple times is allowed, you just have to | 110 // count is tracked, so calling multiple times is allowed, you just have to |
111 // be sure to call PopForceHidden the same number of times. | 111 // be sure to call PopForceHidden the same number of times. |
112 void PushForceHidden(); | 112 void PushForceHidden(); |
113 | 113 |
114 // Decrements the force hidden count, showing the window if we have reached | 114 // Decrements the force hidden count, showing the window if we have reached |
115 // the top of the stack. See PushForceHidden. | 115 // the top of the stack. See PushForceHidden. |
116 void PopForceHidden(); | 116 void PopForceHidden(); |
117 | 117 |
118 // Places the window in a pseudo-fullscreen mode where it looks and acts as | |
119 // like a fullscreen window except that it remains within the boundaries | |
120 // of the metro snap divider. | |
121 void SetMetroSnapFullscreen(bool metro_snap); | |
122 | |
118 BOOL IsWindow() const { | 123 BOOL IsWindow() const { |
119 return ::IsWindow(GetNativeView()); | 124 return ::IsWindow(GetNativeView()); |
120 } | 125 } |
121 | 126 |
122 BOOL ShowWindow(int command) { | 127 BOOL ShowWindow(int command) { |
123 DCHECK(::IsWindow(GetNativeView())); | 128 DCHECK(::IsWindow(GetNativeView())); |
124 return ::ShowWindow(GetNativeView(), command); | 129 return ::ShowWindow(GetNativeView(), command); |
125 } | 130 } |
126 | 131 |
127 HWND GetParent() const { | 132 HWND GetParent() const { |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
524 void RestoreEnabledIfNecessary(); | 529 void RestoreEnabledIfNecessary(); |
525 | 530 |
526 void SetInitialFocus(); | 531 void SetInitialFocus(); |
527 | 532 |
528 // Notifies any owned windows that we're closing. | 533 // Notifies any owned windows that we're closing. |
529 void NotifyOwnedWindowsParentClosing(); | 534 void NotifyOwnedWindowsParentClosing(); |
530 | 535 |
531 // Overridden from internal::InputMethodDelegate | 536 // Overridden from internal::InputMethodDelegate |
532 virtual void DispatchKeyEventPostIME(const KeyEvent& key) OVERRIDE; | 537 virtual void DispatchKeyEventPostIME(const KeyEvent& key) OVERRIDE; |
533 | 538 |
539 // Common implementation of fullscreen-related code. | |
sky
2012/06/11 17:04:31
fullscreen is confusingly named here. Additionally
robertshield
2012/06/11 21:06:57
Added more detailed comment. Please let me know if
| |
540 void SetFullscreenInternal(bool fullscreen, | |
541 const gfx::Rect& window_rect); | |
542 | |
534 // A delegate implementation that handles events received here. | 543 // A delegate implementation that handles events received here. |
535 // See class documentation for Widget in widget.h for a note about ownership. | 544 // See class documentation for Widget in widget.h for a note about ownership. |
536 internal::NativeWidgetDelegate* delegate_; | 545 internal::NativeWidgetDelegate* delegate_; |
537 | 546 |
538 // The following factory is used for calls to close the NativeWidgetWin | 547 // The following factory is used for calls to close the NativeWidgetWin |
539 // instance. | 548 // instance. |
540 base::WeakPtrFactory<NativeWidgetWin> close_widget_factory_; | 549 base::WeakPtrFactory<NativeWidgetWin> close_widget_factory_; |
541 | 550 |
542 // The flags currently being used with TrackMouseEvent to track mouse | 551 // The flags currently being used with TrackMouseEvent to track mouse |
543 // messages. 0 if there is no active tracking. The value of this member is | 552 // messages. 0 if there is no active tracking. The value of this member is |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
605 | 614 |
606 // The last cursor that was active before the current one was selected. Saved | 615 // The last cursor that was active before the current one was selected. Saved |
607 // so that we can restore it. | 616 // so that we can restore it. |
608 gfx::NativeCursor previous_cursor_; | 617 gfx::NativeCursor previous_cursor_; |
609 | 618 |
610 ViewProps props_; | 619 ViewProps props_; |
611 | 620 |
612 // True if we're in fullscreen mode. | 621 // True if we're in fullscreen mode. |
613 bool fullscreen_; | 622 bool fullscreen_; |
614 | 623 |
624 // True if we're in metro snap mode. | |
625 bool metro_snap_; | |
sky
2012/06/11 17:04:31
Initialize this.
robertshield
2012/06/11 21:06:57
Done.
| |
626 | |
615 // If this is greater than zero, we should prevent attempts to make the window | 627 // If this is greater than zero, we should prevent attempts to make the window |
616 // visible when we handle WM_WINDOWPOSCHANGING. Some calls like | 628 // visible when we handle WM_WINDOWPOSCHANGING. Some calls like |
617 // ShowWindow(SW_RESTORE) make the window visible in addition to restoring it, | 629 // ShowWindow(SW_RESTORE) make the window visible in addition to restoring it, |
618 // when all we want to do is restore it. | 630 // when all we want to do is restore it. |
619 int force_hidden_count_; | 631 int force_hidden_count_; |
620 | 632 |
621 // The window styles before we modified them for the drag frame appearance. | 633 // The window styles before we modified them for the drag frame appearance. |
622 DWORD drag_frame_saved_window_style_; | 634 DWORD drag_frame_saved_window_style_; |
623 DWORD drag_frame_saved_window_ex_style_; | 635 DWORD drag_frame_saved_window_ex_style_; |
624 | 636 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
662 | 674 |
663 // The set of touch devices currently down. | 675 // The set of touch devices currently down. |
664 TouchIDs touch_ids_; | 676 TouchIDs touch_ids_; |
665 | 677 |
666 DISALLOW_COPY_AND_ASSIGN(NativeWidgetWin); | 678 DISALLOW_COPY_AND_ASSIGN(NativeWidgetWin); |
667 }; | 679 }; |
668 | 680 |
669 } // namespace views | 681 } // namespace views |
670 | 682 |
671 #endif // UI_VIEWS_WIDGET_NATIVE_WIDGET_WIN_H_ | 683 #endif // UI_VIEWS_WIDGET_NATIVE_WIDGET_WIN_H_ |
OLD | NEW |