Commit 3dc858ba authored by ananta's avatar ananta Committed by Commit Bot

Fix a crash in the fullscreen handler on Windows which occurs due to CHECK for...

Fix a crash in the fullscreen handler on Windows which occurs due to CHECK for success in creating the TaskBarList

It looks like assuming this COM object to be available in all cases is incorrect. We have other users in Chrome who
use this on a best effort basis. Additionally we need to call the HrInit() method on the ITaskBarList2 interface before
using it.

BUG=740376
TBR=msw

Review-Url: https://codereview.chromium.org/2978453002
Cr-Commit-Position: refs/heads/master@{#485161}
parent b0ad7c5c
......@@ -90,7 +90,8 @@ void FullscreenHandler::SetFullscreenImpl(bool fullscreen) {
HRESULT hr = ::CoCreateInstance(CLSID_TaskbarList, NULL,
CLSCTX_INPROC_SERVER,
IID_PPV_ARGS(&task_bar_list_));
CHECK(SUCCEEDED(hr));
if (SUCCEEDED(hr) && FAILED(task_bar_list_->HrInit()))
task_bar_list_ = nullptr;
}
// As per MSDN marking the window as fullscreen should ensure that the
......@@ -98,7 +99,8 @@ void FullscreenHandler::SetFullscreenImpl(bool fullscreen) {
// is activated. If the window is not fullscreen, the Shell falls back to
// heuristics to determine how the window should be treated, which means
// that it could still consider the window as fullscreen. :(
task_bar_list_->MarkFullscreenWindow(hwnd_, !!fullscreen);
if (task_bar_list_)
task_bar_list_->MarkFullscreenWindow(hwnd_, !!fullscreen);
}
} // namespace views
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment