| 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 #include "ui/views/win/fullscreen_handler.h" | 5 #include "ui/views/win/fullscreen_handler.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/win/win_util.h" | 10 #include "base/win/win_util.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 // repainted. Better-looking methods welcome. | 78 // repainted. Better-looking methods welcome. |
| 79 SetWindowLong(hwnd_, GWL_STYLE, saved_window_info_.style); | 79 SetWindowLong(hwnd_, GWL_STYLE, saved_window_info_.style); |
| 80 SetWindowLong(hwnd_, GWL_EXSTYLE, saved_window_info_.ex_style); | 80 SetWindowLong(hwnd_, GWL_EXSTYLE, saved_window_info_.ex_style); |
| 81 | 81 |
| 82 // On restore, resize to the previous saved rect size. | 82 // On restore, resize to the previous saved rect size. |
| 83 gfx::Rect new_rect(saved_window_info_.window_rect); | 83 gfx::Rect new_rect(saved_window_info_.window_rect); |
| 84 SetWindowPos(hwnd_, NULL, new_rect.x(), new_rect.y(), new_rect.width(), | 84 SetWindowPos(hwnd_, NULL, new_rect.x(), new_rect.y(), new_rect.width(), |
| 85 new_rect.height(), | 85 new_rect.height(), |
| 86 SWP_NOZORDER | SWP_NOACTIVATE | SWP_FRAMECHANGED); | 86 SWP_NOZORDER | SWP_NOACTIVATE | SWP_FRAMECHANGED); |
| 87 } | 87 } |
| 88 |
| 89 if (!task_bar_list_) { |
| 90 HRESULT hr = ::CoCreateInstance(CLSID_TaskbarList, NULL, |
| 91 CLSCTX_INPROC_SERVER, |
| 92 IID_PPV_ARGS(&task_bar_list_)); |
| 93 CHECK(SUCCEEDED(hr)); |
| 94 } |
| 95 |
| 96 // As per MSDN marking the window as fullscreen should ensure that the |
| 97 // taskbar is moved to the bottom of the Z-order when the fullscreen window |
| 98 // is activated. If the window is not fullscreen, the Shell falls back to |
| 99 // heuristics to determine how the window should be treated, which means |
| 100 // that it could still consider the window as fullscreen. :( |
| 101 task_bar_list_->MarkFullscreenWindow(hwnd_, !!fullscreen); |
| 88 } | 102 } |
| 89 | 103 |
| 90 } // namespace views | 104 } // namespace views |
| OLD | NEW |