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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/win/fullscreen_handler.cc
diff --git a/ui/views/win/fullscreen_handler.cc b/ui/views/win/fullscreen_handler.cc
index c35bad52ccaed03e81f9c7fb3975b5c9fc6e2e7d..6cbe30ade52fce0d7547bb64fda57be81bde0b11 100644
--- a/ui/views/win/fullscreen_handler.cc
+++ b/ui/views/win/fullscreen_handler.cc
@@ -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;
msw 2017/07/10 18:53:31 Maybe we should have a flag to avoid retrying crea
}
// 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
« 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