| 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 #ifndef WEBKIT_GLUE_WEBMENURUNNER_MAC_H_ | 5 #ifndef WEBKIT_GLUE_WEBMENURUNNER_MAC_H_ |
| 6 #define WEBKIT_GLUE_WEBMENURUNNER_MAC_H_ | 6 #define WEBKIT_GLUE_WEBMENURUNNER_MAC_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 - (void)runMenuInView:(NSView*)view | 51 - (void)runMenuInView:(NSView*)view |
| 52 withBounds:(NSRect)bounds | 52 withBounds:(NSRect)bounds |
| 53 initialIndex:(int)index; | 53 initialIndex:(int)index; |
| 54 | 54 |
| 55 // Returns the index of selected menu item, or its initial value (-1) if no item | 55 // Returns the index of selected menu item, or its initial value (-1) if no item |
| 56 // was selected. | 56 // was selected. |
| 57 - (int)indexOfSelectedItem; | 57 - (int)indexOfSelectedItem; |
| 58 | 58 |
| 59 @end // @interface WebMenuRunner | 59 @end // @interface WebMenuRunner |
| 60 | 60 |
| 61 namespace webkit_glue { | |
| 62 // Helper function for users of WebMenuRunner, for manufacturing input events to | |
| 63 // send to WebKit. If |item_chosen| is YES, we manufacture a mouse click event | |
| 64 // that corresponds to the menu item that was selected, |selected_index|, based | |
| 65 // on the position of the mouse click. Of |item_chosen| is NO, we create a | |
| 66 // keyboard event that simulates an ESC (menu dismissal) action. The event is | |
| 67 // designed to be sent to WebKit for processing by the PopupMenu class. | |
| 68 NSEvent* EventWithMenuAction(BOOL item_chosen, int window_num, | |
| 69 int item_height, int selected_index, | |
| 70 NSRect menu_bounds, NSRect view_bounds); | |
| 71 } // namespace webkit_glue | |
| 72 | |
| 73 #endif // WEBKIT_GLUE_WEBMENURUNNER_MAC_H_ | 61 #endif // WEBKIT_GLUE_WEBMENURUNNER_MAC_H_ |
| OLD | NEW |