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

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

Issue 2880623002: [ash-md] Fixed MenuButton focus appearing after dismissing menus. (Closed)
Patch Set: Added check for null Widget. Created 3 years, 7 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
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/widget.h" 5 #include "ui/views/widget/widget.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after
976 } 976 }
977 977
978 const TooltipManager* Widget::GetTooltipManager() const { 978 const TooltipManager* Widget::GetTooltipManager() const {
979 return native_widget_->GetTooltipManager(); 979 return native_widget_->GetTooltipManager();
980 } 980 }
981 981
982 gfx::Rect Widget::GetWorkAreaBoundsInScreen() const { 982 gfx::Rect Widget::GetWorkAreaBoundsInScreen() const {
983 return native_widget_->GetWorkAreaBoundsInScreen(); 983 return native_widget_->GetWorkAreaBoundsInScreen();
984 } 984 }
985 985
986 void Widget::SynthesizeMouseMoveEvent() { 986 void Widget::SynthesizeMouseMoveEvent(bool force) {
987 // In screen coordinate. 987 // In screen coordinate.
988 gfx::Point mouse_location = EventMonitor::GetLastMouseLocation(); 988 gfx::Point mouse_location = EventMonitor::GetLastMouseLocation();
989 if (!GetWindowBoundsInScreen().Contains(mouse_location)) 989 if (!force && !GetWindowBoundsInScreen().Contains(mouse_location))
990 return; 990 return;
991 991
992 // Convert: screen coordinate -> widget coordinate. 992 // Convert: screen coordinate -> widget coordinate.
993 View::ConvertPointFromScreen(root_view_.get(), &mouse_location); 993 View::ConvertPointFromScreen(root_view_.get(), &mouse_location);
994 last_mouse_event_was_move_ = false; 994 last_mouse_event_was_move_ = false;
995 ui::MouseEvent mouse_event(ui::ET_MOUSE_MOVED, mouse_location, 995 ui::MouseEvent mouse_event(ui::ET_MOUSE_MOVED, mouse_location,
996 mouse_location, ui::EventTimeForNow(), 996 mouse_location, ui::EventTimeForNow(),
997 ui::EF_IS_SYNTHESIZED, 0); 997 ui::EF_IS_SYNTHESIZED, 0);
998 root_view_->OnMouseMoved(mouse_event); 998 root_view_->OnMouseMoved(mouse_event);
999 } 999 }
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
1567 1567
1568 //////////////////////////////////////////////////////////////////////////////// 1568 ////////////////////////////////////////////////////////////////////////////////
1569 // internal::NativeWidgetPrivate, NativeWidget implementation: 1569 // internal::NativeWidgetPrivate, NativeWidget implementation:
1570 1570
1571 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { 1571 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() {
1572 return this; 1572 return this;
1573 } 1573 }
1574 1574
1575 } // namespace internal 1575 } // namespace internal
1576 } // namespace views 1576 } // namespace views
OLDNEW
« ui/views/controls/button/menu_button.cc ('K') | « ui/views/widget/widget.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698