| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CONTENT_BROWSER_RENDERER_HOST_WEBMENURUNNER_MAC_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_WEBMENURUNNER_MAC_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_WEBMENURUNNER_MAC_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_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/memory/scoped_nsobject.h" | 12 #include "base/mac/scoped_nsobject.h" |
| 13 #include "webkit/common/webmenuitem.h" | 13 #include "webkit/common/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 |
| 24 // The native menu control. | 24 // The native menu control. |
| 25 scoped_nsobject<NSMenu> menu_; | 25 base::scoped_nsobject<NSMenu> menu_; |
| 26 | 26 |
| 27 // A flag set to YES if a menu item was chosen, or NO if the menu was | 27 // A flag set to YES if a menu item was chosen, or NO if the menu was |
| 28 // dismissed without selecting an item. | 28 // dismissed without selecting an item. |
| 29 BOOL menuItemWasChosen_; | 29 BOOL menuItemWasChosen_; |
| 30 | 30 |
| 31 // The index of the selected menu item. | 31 // The index of the selected menu item. |
| 32 int index_; | 32 int index_; |
| 33 | 33 |
| 34 // The font size being used for the menu. | 34 // The font size being used for the menu. |
| 35 CGFloat fontSize_; | 35 CGFloat fontSize_; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 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 #endif // CONTENT_BROWSER_RENDERER_HOST_WEBMENURUNNER_MAC_H_ | 61 #endif // CONTENT_BROWSER_RENDERER_HOST_WEBMENURUNNER_MAC_H_ |
| OLD | NEW |