| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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> |
| 11 | 11 |
| 12 #include "base/scoped_nsobject.h" | 12 #include "base/scoped_nsobject.h" |
| 13 #include "webkit/glue/webwidget_delegate.h" | 13 #include "webkit/glue/webmenuitem.h" |
| 14 | 14 |
| 15 | 15 |
| 16 // WebMenuRunner --------------------------------------------------------------- | 16 // WebMenuRunner --------------------------------------------------------------- |
| 17 // A class for determining whether an item was selected from an HTML select | 17 // A class for determining whether an item was selected from an HTML select |
| 18 // control, or if the menu was dismissed without making a selection. If a menu | 18 // control, or if the menu was dismissed without making a selection. If a menu |
| 19 // item is selected, MenuDelegate is informed and sets a flag which can be | 19 // item is selected, MenuDelegate is informed and sets a flag which can be |
| 20 // queried after the menu has finished running. | 20 // queried after the menu has finished running. |
| 21 | 21 |
| 22 @interface WebMenuRunner : NSObject { | 22 @interface WebMenuRunner : NSObject { |
| 23 @private | 23 @private |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 // that corresponds to the menu item that was selected, |selected_index|, based | 56 // that corresponds to the menu item that was selected, |selected_index|, based |
| 57 // on the position of the mouse click. Of |item_chosen| is NO, we create a | 57 // on the position of the mouse click. Of |item_chosen| is NO, we create a |
| 58 // keyboard event that simulates an ESC (menu dismissal) action. The event is | 58 // keyboard event that simulates an ESC (menu dismissal) action. The event is |
| 59 // designed to be sent to WebKit for processing by the PopupMenu class. | 59 // designed to be sent to WebKit for processing by the PopupMenu class. |
| 60 NSEvent* EventWithMenuAction(BOOL item_chosen, int window_num, | 60 NSEvent* EventWithMenuAction(BOOL item_chosen, int window_num, |
| 61 int item_height, int selected_index, | 61 int item_height, int selected_index, |
| 62 NSRect menu_bounds, NSRect view_bounds); | 62 NSRect menu_bounds, NSRect view_bounds); |
| 63 } // namespace webkit_glue | 63 } // namespace webkit_glue |
| 64 | 64 |
| 65 #endif // WEBKIT_GLUE_WEBMENURUNNER_MAC_H_ | 65 #endif // WEBKIT_GLUE_WEBMENURUNNER_MAC_H_ |
| OLD | NEW |