| 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_FULLSCREEN_HANDLER_H_ | 5 #ifndef UI_VIEWS_WIN_FULLSCREEN_HANDLER_H_ |
| 6 #define UI_VIEWS_WIN_FULLSCREEN_HANDLER_H_ | 6 #define UI_VIEWS_WIN_FULLSCREEN_HANDLER_H_ |
| 7 | 7 |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 | 13 |
| 14 namespace gfx { | 14 namespace gfx { |
| 15 class Rect; | 15 class Rect; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace views { | 18 namespace views { |
| 19 | 19 |
| 20 // TODO(beng): Temporary dependancy until fullscreen moves to | |
| 21 // HWNDMessageHandler. | |
| 22 class Widget; | |
| 23 | |
| 24 class FullscreenHandler { | 20 class FullscreenHandler { |
| 25 public: | 21 public: |
| 26 explicit FullscreenHandler(Widget* widget); | 22 FullscreenHandler(); |
| 27 ~FullscreenHandler(); | 23 ~FullscreenHandler(); |
| 28 | 24 |
| 25 void set_hwnd(HWND hwnd) { hwnd_ = hwnd; } |
| 26 |
| 29 void SetFullscreen(bool fullscreen); | 27 void SetFullscreen(bool fullscreen); |
| 30 void SetMetroSnap(bool metro_snap); | 28 void SetMetroSnap(bool metro_snap); |
| 31 | 29 |
| 32 gfx::Rect GetRestoreBounds() const; | 30 gfx::Rect GetRestoreBounds() const; |
| 33 | 31 |
| 34 bool fullscreen() const { return fullscreen_; } | 32 bool fullscreen() const { return fullscreen_; } |
| 35 bool metro_snap() const { return metro_snap_; } | 33 bool metro_snap() const { return metro_snap_; } |
| 36 | 34 |
| 37 private: | 35 private: |
| 38 // Information saved before going into fullscreen mode, used to restore the | 36 // Information saved before going into fullscreen mode, used to restore the |
| 39 // window afterwards. | 37 // window afterwards. |
| 40 struct SavedWindowInfo { | 38 struct SavedWindowInfo { |
| 41 bool maximized; | 39 bool maximized; |
| 42 LONG style; | 40 LONG style; |
| 43 LONG ex_style; | 41 LONG ex_style; |
| 44 RECT window_rect; | 42 RECT window_rect; |
| 45 }; | 43 }; |
| 46 | 44 |
| 47 void SetFullscreenImpl(bool fullscreen, bool for_metro); | 45 void SetFullscreenImpl(bool fullscreen, bool for_metro); |
| 48 | 46 |
| 49 Widget* widget_; | 47 HWND hwnd_; |
| 50 bool fullscreen_; | 48 bool fullscreen_; |
| 51 bool metro_snap_; | 49 bool metro_snap_; |
| 52 | 50 |
| 53 // Saved window information from before entering fullscreen mode. | 51 // Saved window information from before entering fullscreen mode. |
| 54 // TODO(beng): move to private once GetRestoredBounds() moves onto Widget. | 52 // TODO(beng): move to private once GetRestoredBounds() moves onto Widget. |
| 55 SavedWindowInfo saved_window_info_; | 53 SavedWindowInfo saved_window_info_; |
| 56 | 54 |
| 57 DISALLOW_COPY_AND_ASSIGN(FullscreenHandler); | 55 DISALLOW_COPY_AND_ASSIGN(FullscreenHandler); |
| 58 }; | 56 }; |
| 59 | 57 |
| 60 } // namespace views | 58 } // namespace views |
| 61 | 59 |
| 62 #endif // UI_VIEWS_WIN_FULLSCREEN_HANDLER_H_ | 60 #endif // UI_VIEWS_WIN_FULLSCREEN_HANDLER_H_ |
| OLD | NEW |