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_WIN_HWND_MESSAGE_HANDLER_H_ | 5 #ifndef UI_VIEWS_WIN_HWND_MESSAGE_HANDLER_H_ |
6 #define UI_VIEWS_WIN_HWND_MESSAGE_HANDLER_H_ | 6 #define UI_VIEWS_WIN_HWND_MESSAGE_HANDLER_H_ |
7 | 7 |
8 #include <windows.h> | 8 #include <windows.h> |
| 9 |
9 #include <stddef.h> | 10 #include <stddef.h> |
10 | 11 #include <memory> |
11 #include <set> | 12 #include <set> |
12 #include <vector> | 13 #include <vector> |
13 | 14 |
14 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
15 #include "base/macros.h" | 16 #include "base/macros.h" |
16 #include "base/memory/scoped_ptr.h" | |
17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
18 #include "base/strings/string16.h" | 18 #include "base/strings/string16.h" |
19 #include "base/win/scoped_gdi_object.h" | 19 #include "base/win/scoped_gdi_object.h" |
20 #include "base/win/win_util.h" | 20 #include "base/win/win_util.h" |
21 #include "ui/accessibility/ax_enums.h" | 21 #include "ui/accessibility/ax_enums.h" |
22 #include "ui/base/ui_base_types.h" | 22 #include "ui/base/ui_base_types.h" |
23 #include "ui/base/win/window_event_target.h" | 23 #include "ui/base/win/window_event_target.h" |
24 #include "ui/events/event.h" | 24 #include "ui/events/event.h" |
25 #include "ui/gfx/geometry/rect.h" | 25 #include "ui/gfx/geometry/rect.h" |
26 #include "ui/gfx/sequential_id_generator.h" | 26 #include "ui/gfx/sequential_id_generator.h" |
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
512 WPARAM w_param, | 512 WPARAM w_param, |
513 LPARAM l_param); | 513 LPARAM l_param); |
514 | 514 |
515 // Helper function for setting the bounds of the HWND. For more information | 515 // Helper function for setting the bounds of the HWND. For more information |
516 // please refer to the SetBounds() function. | 516 // please refer to the SetBounds() function. |
517 void SetBoundsInternal(const gfx::Rect& bounds_in_pixels, | 517 void SetBoundsInternal(const gfx::Rect& bounds_in_pixels, |
518 bool force_size_changed); | 518 bool force_size_changed); |
519 | 519 |
520 HWNDMessageHandlerDelegate* delegate_; | 520 HWNDMessageHandlerDelegate* delegate_; |
521 | 521 |
522 scoped_ptr<FullscreenHandler> fullscreen_handler_; | 522 std::unique_ptr<FullscreenHandler> fullscreen_handler_; |
523 | 523 |
524 // Set to true in Close() and false is CloseNow(). | 524 // Set to true in Close() and false is CloseNow(). |
525 bool waiting_for_close_now_; | 525 bool waiting_for_close_now_; |
526 | 526 |
527 bool use_system_default_icon_; | 527 bool use_system_default_icon_; |
528 | 528 |
529 // Whether all ancestors have been enabled. This is only used if is_modal_ is | 529 // Whether all ancestors have been enabled. This is only used if is_modal_ is |
530 // true. | 530 // true. |
531 bool restored_enabled_; | 531 bool restored_enabled_; |
532 | 532 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 ui::SequentialIDGenerator id_generator_; | 588 ui::SequentialIDGenerator id_generator_; |
589 | 589 |
590 // Indicates if the window needs the WS_VSCROLL and WS_HSCROLL styles. | 590 // Indicates if the window needs the WS_VSCROLL and WS_HSCROLL styles. |
591 bool needs_scroll_styles_; | 591 bool needs_scroll_styles_; |
592 | 592 |
593 // Set to true if we are in the context of a sizing operation. | 593 // Set to true if we are in the context of a sizing operation. |
594 bool in_size_loop_; | 594 bool in_size_loop_; |
595 | 595 |
596 // Stores a pointer to the WindowEventTarget interface implemented by this | 596 // Stores a pointer to the WindowEventTarget interface implemented by this |
597 // class. Allows callers to retrieve the interface pointer. | 597 // class. Allows callers to retrieve the interface pointer. |
598 scoped_ptr<ui::ViewProp> prop_window_target_; | 598 std::unique_ptr<ui::ViewProp> prop_window_target_; |
599 | 599 |
600 // Number of active touch down contexts. This is incremented on touch down | 600 // Number of active touch down contexts. This is incremented on touch down |
601 // events and decremented later using a delayed task. | 601 // events and decremented later using a delayed task. |
602 // We need this to ignore WM_MOUSEACTIVATE messages generated in response to | 602 // We need this to ignore WM_MOUSEACTIVATE messages generated in response to |
603 // touch input. This is fine because activation still works correctly via | 603 // touch input. This is fine because activation still works correctly via |
604 // native SetFocus calls invoked in the views code. | 604 // native SetFocus calls invoked in the views code. |
605 int touch_down_contexts_; | 605 int touch_down_contexts_; |
606 | 606 |
607 // Time the last touch message was received. Used to flag mouse messages | 607 // Time the last touch message was received. Used to flag mouse messages |
608 // synthesized by Windows for touch which are not flagged by the OS as | 608 // synthesized by Windows for touch which are not flagged by the OS as |
(...skipping 11 matching lines...) Expand all Loading... |
620 // the DWM related operations when the window comes out of fullscreen mode. | 620 // the DWM related operations when the window comes out of fullscreen mode. |
621 // This member variable is set to true if the window is transitioning to | 621 // This member variable is set to true if the window is transitioning to |
622 // glass. Defaults to false. | 622 // glass. Defaults to false. |
623 bool dwm_transition_desired_; | 623 bool dwm_transition_desired_; |
624 | 624 |
625 // True if HandleWindowSizeChanging has been called in the delegate, but not | 625 // True if HandleWindowSizeChanging has been called in the delegate, but not |
626 // HandleWindowSizeChanged. | 626 // HandleWindowSizeChanged. |
627 bool sent_window_size_changing_; | 627 bool sent_window_size_changing_; |
628 | 628 |
629 // Manages observation of Windows Session Change messages. | 629 // Manages observation of Windows Session Change messages. |
630 scoped_ptr<WindowsSessionChangeObserver> windows_session_change_observer_; | 630 std::unique_ptr<WindowsSessionChangeObserver> |
| 631 windows_session_change_observer_; |
631 | 632 |
632 // This class provides functionality to register the legacy window as a | 633 // This class provides functionality to register the legacy window as a |
633 // Direct Manipulation consumer. This allows us to support smooth scroll | 634 // Direct Manipulation consumer. This allows us to support smooth scroll |
634 // in Chrome on Windows 10. | 635 // in Chrome on Windows 10. |
635 scoped_ptr<gfx::win::DirectManipulationHelper> direct_manipulation_helper_; | 636 std::unique_ptr<gfx::win::DirectManipulationHelper> |
| 637 direct_manipulation_helper_; |
636 | 638 |
637 // The location where the user clicked on the caption. We cache this when we | 639 // The location where the user clicked on the caption. We cache this when we |
638 // receive the WM_NCLBUTTONDOWN message. We use this in the subsequent | 640 // receive the WM_NCLBUTTONDOWN message. We use this in the subsequent |
639 // WM_NCMOUSEMOVE message to see if the mouse actually moved. | 641 // WM_NCMOUSEMOVE message to see if the mouse actually moved. |
640 // Please refer to the HandleMouseEventInternal function for details on why | 642 // Please refer to the HandleMouseEventInternal function for details on why |
641 // this is needed. | 643 // this is needed. |
642 gfx::Point caption_left_button_click_pos_; | 644 gfx::Point caption_left_button_click_pos_; |
643 | 645 |
644 // Set to true if the left mouse button has been pressed on the caption. | 646 // Set to true if the left mouse button has been pressed on the caption. |
645 // Defaults to false. | 647 // Defaults to false. |
(...skipping 11 matching lines...) Expand all Loading... |
657 | 659 |
658 // The factory used with BEGIN_SAFE_MSG_MAP_EX. | 660 // The factory used with BEGIN_SAFE_MSG_MAP_EX. |
659 base::WeakPtrFactory<HWNDMessageHandler> weak_factory_; | 661 base::WeakPtrFactory<HWNDMessageHandler> weak_factory_; |
660 | 662 |
661 DISALLOW_COPY_AND_ASSIGN(HWNDMessageHandler); | 663 DISALLOW_COPY_AND_ASSIGN(HWNDMessageHandler); |
662 }; | 664 }; |
663 | 665 |
664 } // namespace views | 666 } // namespace views |
665 | 667 |
666 #endif // UI_VIEWS_WIN_HWND_MESSAGE_HANDLER_H_ | 668 #endif // UI_VIEWS_WIN_HWND_MESSAGE_HANDLER_H_ |
OLD | NEW |