| OLD | NEW |
| 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/test/base/ui_test_utils.h" | 5 #include "chrome/test/base/ui_test_utils.h" |
| 6 | 6 |
| 7 #include <Carbon/Carbon.h> | 7 #include <Carbon/Carbon.h> |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 void ClickOnView(const Browser* browser, ViewID vid) { | 41 void ClickOnView(const Browser* browser, ViewID vid) { |
| 42 NSWindow* window = browser->window()->GetNativeHandle(); | 42 NSWindow* window = browser->window()->GetNativeHandle(); |
| 43 DCHECK(window); | 43 DCHECK(window); |
| 44 NSView* view = view_id_util::GetView(window, vid); | 44 NSView* view = view_id_util::GetView(window, vid); |
| 45 DCHECK(view); | 45 DCHECK(view); |
| 46 ui_controls::MoveMouseToCenterAndPress( | 46 ui_controls::MoveMouseToCenterAndPress( |
| 47 view, | 47 view, |
| 48 ui_controls::LEFT, | 48 ui_controls::LEFT, |
| 49 ui_controls::DOWN | ui_controls::UP, | 49 ui_controls::DOWN | ui_controls::UP, |
| 50 new MessageLoop::QuitTask()); | 50 MessageLoop::QuitClosure()); |
| 51 RunMessageLoop(); | 51 RunMessageLoop(); |
| 52 } | 52 } |
| 53 | 53 |
| 54 void HideNativeWindow(gfx::NativeWindow window) { | 54 void HideNativeWindow(gfx::NativeWindow window) { |
| 55 [window orderOut:nil]; | 55 [window orderOut:nil]; |
| 56 } | 56 } |
| 57 | 57 |
| 58 void ShowAndFocusNativeWindow(gfx::NativeWindow window) { | 58 void ShowAndFocusNativeWindow(gfx::NativeWindow window) { |
| 59 // Make sure an unbundled program can get the input focus. | 59 // Make sure an unbundled program can get the input focus. |
| 60 ProcessSerialNumber psn = { 0, kCurrentProcess }; | 60 ProcessSerialNumber psn = { 0, kCurrentProcess }; |
| 61 TransformProcessType(&psn,kProcessTransformToForegroundApplication); | 61 TransformProcessType(&psn,kProcessTransformToForegroundApplication); |
| 62 SetFrontProcess(&psn); | 62 SetFrontProcess(&psn); |
| 63 | 63 |
| 64 [window makeKeyAndOrderFront:nil]; | 64 [window makeKeyAndOrderFront:nil]; |
| 65 } | 65 } |
| 66 | 66 |
| 67 } // namespace ui_test_utils | 67 } // namespace ui_test_utils |
| OLD | NEW |