Chromium Code Reviews| 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 |
| 10 #include <stddef.h> | 10 #include <stddef.h> |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 206 | 206 |
| 207 void SetFullscreen(bool fullscreen); | 207 void SetFullscreen(bool fullscreen); |
| 208 | 208 |
| 209 // Updates the window style to reflect whether it can be resized or maximized. | 209 // Updates the window style to reflect whether it can be resized or maximized. |
| 210 void SizeConstraintsChanged(); | 210 void SizeConstraintsChanged(); |
| 211 | 211 |
| 212 // Returns true if content is rendered to a child window instead of directly | 212 // Returns true if content is rendered to a child window instead of directly |
| 213 // to this window. | 213 // to this window. |
| 214 bool HasChildRenderingWindow(); | 214 bool HasChildRenderingWindow(); |
| 215 | 215 |
| 216 void set_translucent(bool translucent) { translucent_ = translucent; } | |
| 217 bool translucent() const { return translucent_; } | |
| 218 | |
| 216 private: | 219 private: |
| 217 typedef std::set<DWORD> TouchIDs; | 220 typedef std::set<DWORD> TouchIDs; |
| 218 enum class DwmFrameState { OFF, ON }; | 221 enum class DwmFrameState { OFF, ON }; |
| 219 | 222 |
| 220 // Overridden from WindowImpl: | 223 // Overridden from WindowImpl: |
| 221 HICON GetDefaultWindowIcon() const override; | 224 HICON GetDefaultWindowIcon() const override; |
| 222 HICON GetSmallWindowIcon() const override; | 225 HICON GetSmallWindowIcon() const override; |
| 223 LRESULT OnWndProc(UINT message, WPARAM w_param, LPARAM l_param) override; | 226 LRESULT OnWndProc(UINT message, WPARAM w_param, LPARAM l_param) override; |
| 224 | 227 |
| 225 // Overridden from WindowEventTarget | 228 // Overridden from WindowEventTarget |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 699 gfx::Point caption_left_button_click_pos_; | 702 gfx::Point caption_left_button_click_pos_; |
| 700 | 703 |
| 701 // Set to true if the left mouse button has been pressed on the caption. | 704 // Set to true if the left mouse button has been pressed on the caption. |
| 702 // Defaults to false. | 705 // Defaults to false. |
| 703 bool left_button_down_on_caption_; | 706 bool left_button_down_on_caption_; |
| 704 | 707 |
| 705 // Set to true if the window is a background fullscreen window, i.e a | 708 // Set to true if the window is a background fullscreen window, i.e a |
| 706 // fullscreen window which lost activation. Defaults to false. | 709 // fullscreen window which lost activation. Defaults to false. |
| 707 bool background_fullscreen_hack_; | 710 bool background_fullscreen_hack_; |
| 708 | 711 |
| 712 // True if the window should have no border and its contents should be | |
| 713 // partially or fully transparent. | |
| 714 bool translucent_ = false; | |
|
sky
2017/04/20 17:26:28
Please rename this is_translucent_ and the setter/
| |
| 715 | |
| 709 // This is a map of the HMONITOR to full screeen window instance. It is safe | 716 // This is a map of the HMONITOR to full screeen window instance. It is safe |
| 710 // to keep a raw pointer to the HWNDMessageHandler instance as we track the | 717 // to keep a raw pointer to the HWNDMessageHandler instance as we track the |
| 711 // window destruction and ensure that the map is cleaned up. | 718 // window destruction and ensure that the map is cleaned up. |
| 712 using FullscreenWindowMonitorMap = std::map<HMONITOR, HWNDMessageHandler*>; | 719 using FullscreenWindowMonitorMap = std::map<HMONITOR, HWNDMessageHandler*>; |
| 713 static base::LazyInstance<FullscreenWindowMonitorMap>::DestructorAtExit | 720 static base::LazyInstance<FullscreenWindowMonitorMap>::DestructorAtExit |
| 714 fullscreen_monitor_map_; | 721 fullscreen_monitor_map_; |
| 715 | 722 |
| 716 // The WeakPtrFactories below must occur last in the class definition so they | 723 // The WeakPtrFactories below must occur last in the class definition so they |
| 717 // get destroyed last. | 724 // get destroyed last. |
| 718 | 725 |
| 719 // The factory used to lookup appbar autohide edges. | 726 // The factory used to lookup appbar autohide edges. |
| 720 base::WeakPtrFactory<HWNDMessageHandler> autohide_factory_; | 727 base::WeakPtrFactory<HWNDMessageHandler> autohide_factory_; |
| 721 | 728 |
| 722 // The factory used with BEGIN_SAFE_MSG_MAP_EX. | 729 // The factory used with BEGIN_SAFE_MSG_MAP_EX. |
| 723 base::WeakPtrFactory<HWNDMessageHandler> weak_factory_; | 730 base::WeakPtrFactory<HWNDMessageHandler> weak_factory_; |
| 724 | 731 |
| 725 DISALLOW_COPY_AND_ASSIGN(HWNDMessageHandler); | 732 DISALLOW_COPY_AND_ASSIGN(HWNDMessageHandler); |
| 726 }; | 733 }; |
| 727 | 734 |
| 728 } // namespace views | 735 } // namespace views |
| 729 | 736 |
| 730 #endif // UI_VIEWS_WIN_HWND_MESSAGE_HANDLER_H_ | 737 #endif // UI_VIEWS_WIN_HWND_MESSAGE_HANDLER_H_ |
| OLD | NEW |