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

Side by Side Diff: ash/autoclick/autoclick_controller.cc

Issue 101573006: Changes MouseEvent constructor to take changed_button_flags. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test; needs updated expectations as mouse entered wasnt sent before because of env::mouse_butto… Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | ash/autoclick/autoclick_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ash/autoclick/autoclick_controller.h" 5 #include "ash/autoclick/autoclick_controller.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/wm/coordinate_conversion.h" 8 #include "ash/wm/coordinate_conversion.h"
9 #include "base/timer/timer.h" 9 #include "base/timer/timer.h"
10 #include "ui/aura/env.h" 10 #include "ui/aura/env.h"
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 gfx::Point click_location(screen_location); 184 gfx::Point click_location(screen_location);
185 anchor_location_ = click_location; 185 anchor_location_ = click_location;
186 wm::ConvertPointFromScreen(root_window, &click_location); 186 wm::ConvertPointFromScreen(root_window, &click_location);
187 187
188 aura::WindowEventDispatcher* dispatcher = root_window->GetDispatcher(); 188 aura::WindowEventDispatcher* dispatcher = root_window->GetDispatcher();
189 dispatcher->ConvertPointToHost(&click_location); 189 dispatcher->ConvertPointToHost(&click_location);
190 190
191 ui::MouseEvent press_event(ui::ET_MOUSE_PRESSED, 191 ui::MouseEvent press_event(ui::ET_MOUSE_PRESSED,
192 click_location, 192 click_location,
193 click_location, 193 click_location,
194 mouse_event_flags_ | ui::EF_LEFT_MOUSE_BUTTON); 194 mouse_event_flags_ | ui::EF_LEFT_MOUSE_BUTTON,
195 ui::EF_LEFT_MOUSE_BUTTON);
195 ui::MouseEvent release_event(ui::ET_MOUSE_RELEASED, 196 ui::MouseEvent release_event(ui::ET_MOUSE_RELEASED,
196 click_location, 197 click_location,
197 click_location, 198 click_location,
198 mouse_event_flags_ | ui::EF_LEFT_MOUSE_BUTTON); 199 mouse_event_flags_ | ui::EF_LEFT_MOUSE_BUTTON,
200 ui::EF_LEFT_MOUSE_BUTTON);
199 201
200 dispatcher->AsRootWindowHostDelegate()->OnHostMouseEvent(&press_event); 202 dispatcher->AsRootWindowHostDelegate()->OnHostMouseEvent(&press_event);
201 dispatcher->AsRootWindowHostDelegate()->OnHostMouseEvent(&release_event); 203 dispatcher->AsRootWindowHostDelegate()->OnHostMouseEvent(&release_event);
202 } 204 }
203 205
204 // static. 206 // static.
205 AutoclickController* AutoclickController::CreateInstance() { 207 AutoclickController* AutoclickController::CreateInstance() {
206 return new AutoclickControllerImpl(); 208 return new AutoclickControllerImpl();
207 } 209 }
208 210
209 } // namespace ash 211 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/autoclick/autoclick_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698