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

Side by Side Diff: chrome/test/ui_test_utils_mac.mm

Issue 3137033: Minor fixes to keep TOT working with the 10.6 SDK. Note use of... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/cocoa/task_manager_mac.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/ui_test_utils.h" 5 #include "chrome/test/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 11 matching lines...) Expand all
22 NSView* view = view_id_util::GetView(window, vid); 22 NSView* view = view_id_util::GetView(window, vid);
23 if (!view) 23 if (!view)
24 return false; 24 return false;
25 25
26 NSResponder* firstResponder = [window firstResponder]; 26 NSResponder* firstResponder = [window firstResponder];
27 if (firstResponder == static_cast<NSResponder*>(view)) 27 if (firstResponder == static_cast<NSResponder*>(view))
28 return true; 28 return true;
29 29
30 // Handle the special case of focusing a TextField. 30 // Handle the special case of focusing a TextField.
31 if ([firstResponder isKindOfClass:[NSTextView class]]) { 31 if ([firstResponder isKindOfClass:[NSTextView class]]) {
32 NSView* delegate = [(NSTextView*)firstResponder delegate]; 32 NSView* delegate = static_cast<NSView*>([(NSTextView*)firstResponder
33 delegate]);
33 if (delegate == view) 34 if (delegate == view)
34 return true; 35 return true;
35 } 36 }
36 37
37 return false; 38 return false;
38 } 39 }
39 40
40 void ClickOnView(const Browser* browser, ViewID vid) { 41 void ClickOnView(const Browser* browser, ViewID vid) {
41 NSWindow* window = browser->window()->GetNativeHandle(); 42 NSWindow* window = browser->window()->GetNativeHandle();
42 DCHECK(window); 43 DCHECK(window);
(...skipping 14 matching lines...) Expand all
57 void ShowAndFocusNativeWindow(gfx::NativeWindow window) { 58 void ShowAndFocusNativeWindow(gfx::NativeWindow window) {
58 // Make sure an unbundled program can get the input focus. 59 // Make sure an unbundled program can get the input focus.
59 ProcessSerialNumber psn = { 0, kCurrentProcess }; 60 ProcessSerialNumber psn = { 0, kCurrentProcess };
60 TransformProcessType(&psn,kProcessTransformToForegroundApplication); 61 TransformProcessType(&psn,kProcessTransformToForegroundApplication);
61 SetFrontProcess(&psn); 62 SetFrontProcess(&psn);
62 63
63 [window makeKeyAndOrderFront:nil]; 64 [window makeKeyAndOrderFront:nil];
64 } 65 }
65 66
66 } // namespace ui_test_utils 67 } // namespace ui_test_utils
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/task_manager_mac.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698