| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "webkit/glue/webmenurunner_mac.h" | 5 #include "webkit/glue/webmenurunner_mac.h" |
| 6 | 6 |
| 7 #include "base/sys_string_conversions.h" | 7 #include "base/sys_string_conversions.h" |
| 8 | 8 |
| 9 #if !defined(MAC_OS_X_VERSION_10_6) || \ | |
| 10 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6 | |
| 11 enum { | |
| 12 NSUserInterfaceLayoutDirectionLeftToRight = 0, | |
| 13 NSUserInterfaceLayoutDirectionRightToLeft = 1 | |
| 14 }; | |
| 15 typedef NSInteger NSUserInterfaceLayoutDirection; | |
| 16 | |
| 17 @interface NSCell (SnowLeopardSDKDeclarations) | |
| 18 - (void)setUserInterfaceLayoutDirection: | |
| 19 (NSUserInterfaceLayoutDirection)layoutDirection; | |
| 20 @end | |
| 21 | |
| 22 enum { | |
| 23 NSTextWritingDirectionEmbedding = (0 << 1), | |
| 24 NSTextWritingDirectionOverride = (1 << 1) | |
| 25 }; | |
| 26 | |
| 27 static NSString* NSWritingDirectionAttributeName = @"NSWritingDirection"; | |
| 28 #endif | |
| 29 | |
| 30 @interface WebMenuRunner (PrivateAPI) | 9 @interface WebMenuRunner (PrivateAPI) |
| 31 | 10 |
| 32 // Worker function used during initialization. | 11 // Worker function used during initialization. |
| 33 - (void)addItem:(const WebMenuItem&)item; | 12 - (void)addItem:(const WebMenuItem&)item; |
| 34 | 13 |
| 35 // A callback for the menu controller object to call when an item is selected | 14 // A callback for the menu controller object to call when an item is selected |
| 36 // from the menu. This is not called if the menu is dismissed without a | 15 // from the menu. This is not called if the menu is dismissed without a |
| 37 // selection. | 16 // selection. |
| 38 - (void)menuItemSelected:(id)sender; | 17 - (void)menuItemSelected:(id)sender; |
| 39 | 18 |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 | 138 |
| 160 if ([self menuItemWasChosen]) | 139 if ([self menuItemWasChosen]) |
| 161 index_ = [cell indexOfSelectedItem]; | 140 index_ = [cell indexOfSelectedItem]; |
| 162 } | 141 } |
| 163 | 142 |
| 164 - (int)indexOfSelectedItem { | 143 - (int)indexOfSelectedItem { |
| 165 return index_; | 144 return index_; |
| 166 } | 145 } |
| 167 | 146 |
| 168 @end // WebMenuRunner | 147 @end // WebMenuRunner |
| OLD | NEW |