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

Side by Side Diff: chrome/test/webdriver/keycode_text_conversion_mac.mm

Issue 16917011: mac: Replace base::mac::ScopedCFTypeRef with base::ScopedCFTypeRef. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: with fixed off-by-1 in git-clang-format Created 7 years, 6 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/test/chromedriver/test_util.cc ('k') | chrome/test/webdriver/webdriver_test_util.h » ('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 (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/webdriver/keycode_text_conversion.h" 5 #include "chrome/test/webdriver/keycode_text_conversion.h"
6 6
7 #import <Carbon/Carbon.h> 7 #import <Carbon/Carbon.h>
8 8
9 #include <cctype> 9 #include <cctype>
10 10
(...skipping 23 matching lines...) Expand all
34 if (modifiers & automation::kControlKeyMask) 34 if (modifiers & automation::kControlKeyMask)
35 mac_modifiers |= controlKey; 35 mac_modifiers |= controlKey;
36 if (modifiers & automation::kAltKeyMask) 36 if (modifiers & automation::kAltKeyMask)
37 mac_modifiers |= optionKey; 37 mac_modifiers |= optionKey;
38 if (modifiers & automation::kMetaKeyMask) 38 if (modifiers & automation::kMetaKeyMask)
39 mac_modifiers |= cmdKey; 39 mac_modifiers |= cmdKey;
40 // Convert EventRecord modifiers to format UCKeyTranslate accepts. See docs 40 // Convert EventRecord modifiers to format UCKeyTranslate accepts. See docs
41 // on UCKeyTranslate for more info. 41 // on UCKeyTranslate for more info.
42 UInt32 modifier_key_state = (mac_modifiers >> 8) & 0xFF; 42 UInt32 modifier_key_state = (mac_modifiers >> 8) & 0xFF;
43 43
44 base::mac::ScopedCFTypeRef<TISInputSourceRef> input_source_copy( 44 base::ScopedCFTypeRef<TISInputSourceRef> input_source_copy(
45 TISCopyCurrentKeyboardLayoutInputSource()); 45 TISCopyCurrentKeyboardLayoutInputSource());
46 CFDataRef layout_data = static_cast<CFDataRef>(TISGetInputSourceProperty( 46 CFDataRef layout_data = static_cast<CFDataRef>(TISGetInputSourceProperty(
47 input_source_copy, kTISPropertyUnicodeKeyLayoutData)); 47 input_source_copy, kTISPropertyUnicodeKeyLayoutData));
48 48
49 UInt32 dead_key_state = 0; 49 UInt32 dead_key_state = 0;
50 UniCharCount char_count = 0; 50 UniCharCount char_count = 0;
51 UniChar character = 0; 51 UniChar character = 0;
52 OSStatus status = UCKeyTranslate( 52 OSStatus status = UCKeyTranslate(
53 reinterpret_cast<const UCKeyboardLayout*>(CFDataGetBytePtr(layout_data)), 53 reinterpret_cast<const UCKeyboardLayout*>(CFDataGetBytePtr(layout_data)),
54 static_cast<UInt16>(mac_key_code), 54 static_cast<UInt16>(mac_key_code),
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 } 93 }
94 if (found_code) { 94 if (found_code) {
95 *key_code = code; 95 *key_code = code;
96 break; 96 break;
97 } 97 }
98 } 98 }
99 return found_code; 99 return found_code;
100 } 100 }
101 101
102 } // namespace webdriver 102 } // namespace webdriver
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/test_util.cc ('k') | chrome/test/webdriver/webdriver_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698