Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(262)

Side by Side Diff: chrome/browser/ui/cocoa/rwhvm_editcommand_helper.mm

Issue 6542027: Out of line cleanups for Mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Killer rebase. :( Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #import "chrome/browser/ui/cocoa/rwhvm_editcommand_helper.h" 5 #import "chrome/browser/ui/cocoa/rwhvm_editcommand_helper.h"
6 6
7 #import <objc/runtime.h> 7 #import <objc/runtime.h>
8 8
9 #include "chrome/browser/renderer_host/render_widget_host.h" 9 #include "chrome/browser/renderer_host/render_widget_host.h"
10 #import "chrome/browser/renderer_host/render_widget_host_view_mac.h" 10 #import "chrome/browser/renderer_host/render_widget_host_view_mac.h"
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 int selector_len = [selector_str length]; 172 int selector_len = [selector_str length];
173 return [selector_str substringToIndex:selector_len - 1]; 173 return [selector_str substringToIndex:selector_len - 1];
174 } 174 }
175 175
176 RWHVMEditCommandHelper::RWHVMEditCommandHelper() { 176 RWHVMEditCommandHelper::RWHVMEditCommandHelper() {
177 for (size_t i = 0; i < arraysize(kEditCommands); ++i) { 177 for (size_t i = 0; i < arraysize(kEditCommands); ++i) {
178 edit_command_set_.insert(kEditCommands[i]); 178 edit_command_set_.insert(kEditCommands[i]);
179 } 179 }
180 } 180 }
181 181
182 RWHVMEditCommandHelper::~RWHVMEditCommandHelper() {}
183
182 // Dynamically adds Selectors to the aformentioned class. 184 // Dynamically adds Selectors to the aformentioned class.
183 void RWHVMEditCommandHelper::AddEditingSelectorsToClass(Class klass) { 185 void RWHVMEditCommandHelper::AddEditingSelectorsToClass(Class klass) {
184 for (size_t i = 0; i < arraysize(kEditCommands); ++i) { 186 for (size_t i = 0; i < arraysize(kEditCommands); ++i) {
185 // Append trailing ':' to command name to get selector name. 187 // Append trailing ':' to command name to get selector name.
186 NSString* sel_str = [NSString stringWithFormat: @"%s:", kEditCommands[i]]; 188 NSString* sel_str = [NSString stringWithFormat: @"%s:", kEditCommands[i]];
187 189
188 SEL edit_selector = NSSelectorFromString(sel_str); 190 SEL edit_selector = NSSelectorFromString(sel_str);
189 // May want to use @encode() for the last parameter to this method. 191 // May want to use @encode() for the last parameter to this method.
190 // If class_addMethod fails we assume that all the editing selectors where 192 // If class_addMethod fails we assume that all the editing selectors where
191 // added to the class. 193 // added to the class.
(...skipping 26 matching lines...) Expand all
218 NSArray* RWHVMEditCommandHelper::GetEditSelectorNames() { 220 NSArray* RWHVMEditCommandHelper::GetEditSelectorNames() {
219 size_t num_edit_commands = arraysize(kEditCommands); 221 size_t num_edit_commands = arraysize(kEditCommands);
220 NSMutableArray* ret = [NSMutableArray arrayWithCapacity:num_edit_commands]; 222 NSMutableArray* ret = [NSMutableArray arrayWithCapacity:num_edit_commands];
221 223
222 for (size_t i = 0; i < num_edit_commands; ++i) { 224 for (size_t i = 0; i < num_edit_commands; ++i) {
223 [ret addObject:[NSString stringWithUTF8String:kEditCommands[i]]]; 225 [ret addObject:[NSString stringWithUTF8String:kEditCommands[i]]];
224 } 226 }
225 227
226 return ret; 228 return ret;
227 } 229 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/rwhvm_editcommand_helper.h ('k') | chrome/browser/ui/cocoa/table_row_nsimage_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698