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

Side by Side Diff: ui/views/widget/native_widget_aura.cc

Issue 2823593002: Prevent crash in NativeWidgetAura::IsMouseEventsEnabled() when no root window (Closed)
Patch Set: Created 3 years, 8 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/widget/native_widget_aura.h" 5 #include "ui/views/widget/native_widget_aura.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 658
659 void NativeWidgetAura::SetCursor(gfx::NativeCursor cursor) { 659 void NativeWidgetAura::SetCursor(gfx::NativeCursor cursor) {
660 cursor_ = cursor; 660 cursor_ = cursor;
661 aura::client::CursorClient* cursor_client = 661 aura::client::CursorClient* cursor_client =
662 aura::client::GetCursorClient(window_->GetRootWindow()); 662 aura::client::GetCursorClient(window_->GetRootWindow());
663 if (cursor_client) 663 if (cursor_client)
664 cursor_client->SetCursor(cursor); 664 cursor_client->SetCursor(cursor);
665 } 665 }
666 666
667 bool NativeWidgetAura::IsMouseEventsEnabled() const { 667 bool NativeWidgetAura::IsMouseEventsEnabled() const {
668 if (!window_) 668 if (!window_ || !window_->GetRootWindow())
669 return false; 669 return false;
670 aura::client::CursorClient* cursor_client = 670 aura::client::CursorClient* cursor_client =
671 aura::client::GetCursorClient(window_->GetRootWindow()); 671 aura::client::GetCursorClient(window_->GetRootWindow());
672 return cursor_client ? cursor_client->IsMouseEventsEnabled() : true; 672 return cursor_client ? cursor_client->IsMouseEventsEnabled() : true;
673 } 673 }
674 674
675 void NativeWidgetAura::ClearNativeFocus() { 675 void NativeWidgetAura::ClearNativeFocus() {
676 aura::client::FocusClient* client = aura::client::GetFocusClient(window_); 676 aura::client::FocusClient* client = aura::client::GetFocusClient(window_);
677 if (window_ && client && window_->Contains(client->GetFocusedWindow())) 677 if (window_ && client && window_->Contains(client->GetFocusedWindow()))
678 client->ResetFocusWithinActiveWindow(window_); 678 client->ResetFocusWithinActiveWindow(window_);
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
1189 gfx::NativeView native_view) { 1189 gfx::NativeView native_view) {
1190 aura::client::CaptureClient* capture_client = 1190 aura::client::CaptureClient* capture_client =
1191 aura::client::GetCaptureClient(native_view->GetRootWindow()); 1191 aura::client::GetCaptureClient(native_view->GetRootWindow());
1192 if (!capture_client) 1192 if (!capture_client)
1193 return nullptr; 1193 return nullptr;
1194 return capture_client->GetGlobalCaptureWindow(); 1194 return capture_client->GetGlobalCaptureWindow();
1195 } 1195 }
1196 1196
1197 } // namespace internal 1197 } // namespace internal
1198 } // namespace views 1198 } // 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