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

Side by Side Diff: chrome/browser/automation/ui_controls_mac.mm

Issue 8437002: Move BrowserThread to content namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: A few updates. Created 9 years, 1 month 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/automation/ui_controls.h" 5 #include "chrome/browser/automation/ui_controls.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 #include <mach/mach_time.h> 8 #include <mach/mach_time.h>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/callback.h" 12 #include "base/callback.h"
13 #include "base/message_loop.h" 13 #include "base/message_loop.h"
14 #include "chrome/browser/automation/ui_controls_internal.h" 14 #include "chrome/browser/automation/ui_controls_internal.h"
15 #include "content/public/browser/browser_thread.h" 15 #include "content/public/browser/browser_thread.h"
16 #include "ui/base/keycodes/keyboard_code_conversion_mac.h" 16 #include "ui/base/keycodes/keyboard_code_conversion_mac.h"
17 17
18 using content::BrowserThread;
19
18 // Implementation details: We use [NSApplication sendEvent:] instead 20 // Implementation details: We use [NSApplication sendEvent:] instead
19 // of [NSApplication postEvent:atStart:] so that the event gets sent 21 // of [NSApplication postEvent:atStart:] so that the event gets sent
20 // immediately. This lets us run the post-event task right 22 // immediately. This lets us run the post-event task right
21 // immediately as well. Unfortunately I cannot subclass NSEvent (it's 23 // immediately as well. Unfortunately I cannot subclass NSEvent (it's
22 // probably a class cluster) to allow other easy answers. For 24 // probably a class cluster) to allow other easy answers. For
23 // example, if I could subclass NSEvent, I could run the Task in it's 25 // example, if I could subclass NSEvent, I could run the Task in it's
24 // dealloc routine (which necessarily happens after the event is 26 // dealloc routine (which necessarily happens after the event is
25 // dispatched). Unlike Linux, Mac does not have message loop 27 // dispatched). Unlike Linux, Mac does not have message loop
26 // observer/notification. Unlike windows, I cannot post non-events 28 // observer/notification. Unlike windows, I cannot post non-events
27 // into the event queue. (I can post other kinds of tasks but can't 29 // into the event queue. (I can post other kinds of tasks but can't
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 center = [view convertPoint:center toView:nil]; 378 center = [view convertPoint:center toView:nil];
377 center = [window convertBaseToScreen:center]; 379 center = [window convertBaseToScreen:center];
378 center = NSMakePoint(center.x, [screen frame].size.height - center.y); 380 center = NSMakePoint(center.x, [screen frame].size.height - center.y);
379 381
380 SendMouseMoveNotifyWhenDone( 382 SendMouseMoveNotifyWhenDone(
381 center.x, center.y, 383 center.x, center.y,
382 base::Bind(&ui_controls::ClickTask, button, state, task)); 384 base::Bind(&ui_controls::ClickTask, button, state, task));
383 } 385 }
384 386
385 } // ui_controls 387 } // ui_controls
OLDNEW
« no previous file with comments | « chrome/browser/automation/testing_automation_provider.cc ('k') | chrome/browser/automation/url_request_automation_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698