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_is_translucent(bool is_translucent) { |
| 217 is_translucent_ = is_translucent; |
| 218 } |
| 219 bool is_translucent() const { return is_translucent_; } |
| 220 |
216 private: | 221 private: |
217 typedef std::set<DWORD> TouchIDs; | 222 typedef std::set<DWORD> TouchIDs; |
218 enum class DwmFrameState { OFF, ON }; | 223 enum class DwmFrameState { OFF, ON }; |
219 | 224 |
220 // Overridden from WindowImpl: | 225 // Overridden from WindowImpl: |
221 HICON GetDefaultWindowIcon() const override; | 226 HICON GetDefaultWindowIcon() const override; |
222 HICON GetSmallWindowIcon() const override; | 227 HICON GetSmallWindowIcon() const override; |
223 LRESULT OnWndProc(UINT message, WPARAM w_param, LPARAM l_param) override; | 228 LRESULT OnWndProc(UINT message, WPARAM w_param, LPARAM l_param) override; |
224 | 229 |
225 // Overridden from WindowEventTarget | 230 // Overridden from WindowEventTarget |
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
699 gfx::Point caption_left_button_click_pos_; | 704 gfx::Point caption_left_button_click_pos_; |
700 | 705 |
701 // Set to true if the left mouse button has been pressed on the caption. | 706 // Set to true if the left mouse button has been pressed on the caption. |
702 // Defaults to false. | 707 // Defaults to false. |
703 bool left_button_down_on_caption_; | 708 bool left_button_down_on_caption_; |
704 | 709 |
705 // Set to true if the window is a background fullscreen window, i.e a | 710 // Set to true if the window is a background fullscreen window, i.e a |
706 // fullscreen window which lost activation. Defaults to false. | 711 // fullscreen window which lost activation. Defaults to false. |
707 bool background_fullscreen_hack_; | 712 bool background_fullscreen_hack_; |
708 | 713 |
| 714 // True if the window should have no border and its contents should be |
| 715 // partially or fully transparent. |
| 716 bool is_translucent_ = false; |
| 717 |
709 // This is a map of the HMONITOR to full screeen window instance. It is safe | 718 // 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 | 719 // to keep a raw pointer to the HWNDMessageHandler instance as we track the |
711 // window destruction and ensure that the map is cleaned up. | 720 // window destruction and ensure that the map is cleaned up. |
712 using FullscreenWindowMonitorMap = std::map<HMONITOR, HWNDMessageHandler*>; | 721 using FullscreenWindowMonitorMap = std::map<HMONITOR, HWNDMessageHandler*>; |
713 static base::LazyInstance<FullscreenWindowMonitorMap>::DestructorAtExit | 722 static base::LazyInstance<FullscreenWindowMonitorMap>::DestructorAtExit |
714 fullscreen_monitor_map_; | 723 fullscreen_monitor_map_; |
715 | 724 |
716 // The WeakPtrFactories below must occur last in the class definition so they | 725 // The WeakPtrFactories below must occur last in the class definition so they |
717 // get destroyed last. | 726 // get destroyed last. |
718 | 727 |
719 // The factory used to lookup appbar autohide edges. | 728 // The factory used to lookup appbar autohide edges. |
720 base::WeakPtrFactory<HWNDMessageHandler> autohide_factory_; | 729 base::WeakPtrFactory<HWNDMessageHandler> autohide_factory_; |
721 | 730 |
722 // The factory used with BEGIN_SAFE_MSG_MAP_EX. | 731 // The factory used with BEGIN_SAFE_MSG_MAP_EX. |
723 base::WeakPtrFactory<HWNDMessageHandler> weak_factory_; | 732 base::WeakPtrFactory<HWNDMessageHandler> weak_factory_; |
724 | 733 |
725 DISALLOW_COPY_AND_ASSIGN(HWNDMessageHandler); | 734 DISALLOW_COPY_AND_ASSIGN(HWNDMessageHandler); |
726 }; | 735 }; |
727 | 736 |
728 } // namespace views | 737 } // namespace views |
729 | 738 |
730 #endif // UI_VIEWS_WIN_HWND_MESSAGE_HANDLER_H_ | 739 #endif // UI_VIEWS_WIN_HWND_MESSAGE_HANDLER_H_ |
OLD | NEW |