OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_BROWSER_UI_COCOA_RWHVM_EDITCOMMAND_HELPER_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_RWHVM_EDITCOMMAND_HELPER_H_ |
6 #define CHROME_BROWSER_UI_COCOA_RWHVM_EDITCOMMAND_HELPER_H_ | 6 #define CHROME_BROWSER_UI_COCOA_RWHVM_EDITCOMMAND_HELPER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #import <Cocoa/Cocoa.h> | 9 #import <Cocoa/Cocoa.h> |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 // fact a distinct object) When these selectors are called, the relevant | 31 // fact a distinct object) When these selectors are called, the relevant |
32 // edit command is executed in WebCore. | 32 // edit command is executed in WebCore. |
33 class RWHVMEditCommandHelper { | 33 class RWHVMEditCommandHelper { |
34 FRIEND_TEST_ALL_PREFIXES(RWHVMEditCommandHelperTest, | 34 FRIEND_TEST_ALL_PREFIXES(RWHVMEditCommandHelperTest, |
35 TestAddEditingSelectorsToClass); | 35 TestAddEditingSelectorsToClass); |
36 FRIEND_TEST_ALL_PREFIXES(RWHVMEditCommandHelperTest, | 36 FRIEND_TEST_ALL_PREFIXES(RWHVMEditCommandHelperTest, |
37 TestEditingCommandDelivery); | 37 TestEditingCommandDelivery); |
38 | 38 |
39 public: | 39 public: |
40 RWHVMEditCommandHelper(); | 40 RWHVMEditCommandHelper(); |
| 41 ~RWHVMEditCommandHelper(); |
41 | 42 |
42 // Adds editing selectors to the objc class using the objc runtime APIs. | 43 // Adds editing selectors to the objc class using the objc runtime APIs. |
43 // Each selector is connected to a single c method which forwards the message | 44 // Each selector is connected to a single c method which forwards the message |
44 // to WebCore's ExecuteEditCommand() function. | 45 // to WebCore's ExecuteEditCommand() function. |
45 // This method is idempotent. | 46 // This method is idempotent. |
46 // The class passed in must conform to the RenderWidgetHostViewMacOwner | 47 // The class passed in must conform to the RenderWidgetHostViewMacOwner |
47 // protocol. | 48 // protocol. |
48 void AddEditingSelectorsToClass(Class klass); | 49 void AddEditingSelectorsToClass(Class klass); |
49 | 50 |
50 // Is a given menu item currently enabled? | 51 // Is a given menu item currently enabled? |
(...skipping 12 matching lines...) Expand all Loading... |
63 // the aforementioned class. | 64 // the aforementioned class. |
64 // returns an array of NSStrings WITHOUT the trailing ':'s. | 65 // returns an array of NSStrings WITHOUT the trailing ':'s. |
65 NSArray* GetEditSelectorNames(); | 66 NSArray* GetEditSelectorNames(); |
66 | 67 |
67 private: | 68 private: |
68 base::hash_set<std::string> edit_command_set_; | 69 base::hash_set<std::string> edit_command_set_; |
69 DISALLOW_COPY_AND_ASSIGN(RWHVMEditCommandHelper); | 70 DISALLOW_COPY_AND_ASSIGN(RWHVMEditCommandHelper); |
70 }; | 71 }; |
71 | 72 |
72 #endif // CHROME_BROWSER_UI_COCOA_RWHVM_EDITCOMMAND_HELPER_H_ | 73 #endif // CHROME_BROWSER_UI_COCOA_RWHVM_EDITCOMMAND_HELPER_H_ |
OLD | NEW |