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

Side by Side Diff: ui/views/controls/menu/menu_message_loop_aura.cc

Issue 1372253002: gfx: Make conversions from gfx::Point to PointF explicit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pointfconvert-gfx: . Created 5 years, 2 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/controls/menu/menu_message_loop_aura.h" 5 #include "ui/views/controls/menu/menu_message_loop_aura.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windowsx.h> 8 #include <windowsx.h>
9 #endif 9 #endif
10 10
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 const gfx::Point& screen_loc) { 113 const gfx::Point& screen_loc) {
114 aura::Window* root = window->GetRootWindow(); 114 aura::Window* root = window->GetRootWindow();
115 ScreenPositionClient* spc = aura::client::GetScreenPositionClient(root); 115 ScreenPositionClient* spc = aura::client::GetScreenPositionClient(root);
116 if (!spc) 116 if (!spc)
117 return; 117 return;
118 118
119 gfx::Point root_loc(screen_loc); 119 gfx::Point root_loc(screen_loc);
120 spc->ConvertPointFromScreen(root, &root_loc); 120 spc->ConvertPointFromScreen(root, &root_loc);
121 121
122 ui::MouseEvent clone(static_cast<const ui::MouseEvent&>(event)); 122 ui::MouseEvent clone(static_cast<const ui::MouseEvent&>(event));
123 clone.set_location(root_loc); 123 clone.set_location(gfx::PointF(root_loc));
124 clone.set_root_location(root_loc); 124 clone.set_root_location(gfx::PointF(root_loc));
125 root->GetHost()->dispatcher()->RepostEvent(clone); 125 root->GetHost()->dispatcher()->RepostEvent(clone);
126 } 126 }
127 127
128 void MenuMessageLoopAura::Run(MenuController* controller, 128 void MenuMessageLoopAura::Run(MenuController* controller,
129 Widget* owner, 129 Widget* owner,
130 bool nested_menu) { 130 bool nested_menu) {
131 // |owner_| may be NULL. 131 // |owner_| may be NULL.
132 owner_ = owner; 132 owner_ = owner;
133 aura::Window* root = GetOwnerRootWindow(owner_); 133 aura::Window* root = GetOwnerRootWindow(owner_);
134 // It is possible for the same MenuMessageLoopAura to start a nested 134 // It is possible for the same MenuMessageLoopAura to start a nested
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 if (ui::PlatformEventSource::GetInstance()) 188 if (ui::PlatformEventSource::GetInstance())
189 ui::PlatformEventSource::GetInstance()->StopCurrentEventStream(); 189 ui::PlatformEventSource::GetInstance()->StopCurrentEventStream();
190 #endif 190 #endif
191 } 191 }
192 192
193 void MenuMessageLoopAura::ClearOwner() { 193 void MenuMessageLoopAura::ClearOwner() {
194 owner_ = NULL; 194 owner_ = NULL;
195 } 195 }
196 196
197 } // namespace views 197 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698