Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: ui/views/win/fullscreen_handler.cc

Issue 2978453002: Fix a crash in the fullscreen handler on Windows which occurs due to CHECK for success in creating … (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 88
89 if (!task_bar_list_) { 89 if (!task_bar_list_) {
90 HRESULT hr = ::CoCreateInstance(CLSID_TaskbarList, NULL, 90 HRESULT hr = ::CoCreateInstance(CLSID_TaskbarList, NULL,
91 CLSCTX_INPROC_SERVER, 91 CLSCTX_INPROC_SERVER,
92 IID_PPV_ARGS(&task_bar_list_)); 92 IID_PPV_ARGS(&task_bar_list_));
93 CHECK(SUCCEEDED(hr)); 93 if (SUCCEEDED(hr) && FAILED(task_bar_list_->HrInit()))
94 task_bar_list_ = nullptr;
msw 2017/07/10 18:53:31 Maybe we should have a flag to avoid retrying crea
94 } 95 }
95 96
96 // As per MSDN marking the window as fullscreen should ensure that the 97 // 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 // 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 // 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 // heuristics to determine how the window should be treated, which means
100 // that it could still consider the window as fullscreen. :( 101 // that it could still consider the window as fullscreen. :(
101 task_bar_list_->MarkFullscreenWindow(hwnd_, !!fullscreen); 102 if (task_bar_list_)
103 task_bar_list_->MarkFullscreenWindow(hwnd_, !!fullscreen);
102 } 104 }
103 105
104 } // namespace views 106 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698