| 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 #include "base/mac_util.h" | 5 #include "base/mac_util.h" |
| 6 #include "base/sys_string_conversions.h" | 6 #include "base/sys_string_conversions.h" |
| 7 #include "chrome/browser/profile.h" | 7 #include "chrome/browser/profile.h" |
| 8 #import "chrome/browser/cocoa/bookmark_name_folder_controller.h" | 8 #import "chrome/browser/cocoa/bookmark_name_folder_controller.h" |
| 9 | 9 |
| 10 @implementation BookmarkNameFolderController | 10 @implementation BookmarkNameFolderController |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 [nameField_ setStringValue:initialName_.get()]; | 32 [nameField_ setStringValue:initialName_.get()]; |
| 33 if (node_) { | 33 if (node_) { |
| 34 // TODO(jrg)?: on Windows the dialog is named either New Folder or | 34 // TODO(jrg)?: on Windows the dialog is named either New Folder or |
| 35 // Edit Folder Name. However, since we're a sheet on the Mac, the | 35 // Edit Folder Name. However, since we're a sheet on the Mac, the |
| 36 // title is never seen. If we switch from a sheet, correct the | 36 // title is never seen. If we switch from a sheet, correct the |
| 37 // title right here. | 37 // title right here. |
| 38 } | 38 } |
| 39 } | 39 } |
| 40 | 40 |
| 41 // TODO(jrg): consider NSModalSession. | 41 // TODO(jrg): consider NSModalSession. |
| 42 - (void)runModal { | 42 - (void)runAsModalSheet { |
| 43 [NSApp beginSheet:[self window] | 43 [NSApp beginSheet:[self window] |
| 44 modalForWindow:parentWindow_ | 44 modalForWindow:parentWindow_ |
| 45 modalDelegate:self | 45 modalDelegate:self |
| 46 didEndSelector:@selector(didEndSheet:returnCode:contextInfo:) | 46 didEndSelector:@selector(didEndSheet:returnCode:contextInfo:) |
| 47 contextInfo:nil]; | 47 contextInfo:nil]; |
| 48 } | 48 } |
| 49 | 49 |
| 50 - (IBAction)cancel:(id)sender { | 50 - (IBAction)cancel:(id)sender { |
| 51 [NSApp endSheet:[self window]]; | 51 [NSApp endSheet:[self window]]; |
| 52 } | 52 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 76 contextInfo:(void*)contextInfo { | 76 contextInfo:(void*)contextInfo { |
| 77 [[self window] orderOut:self]; | 77 [[self window] orderOut:self]; |
| 78 [self autorelease]; | 78 [self autorelease]; |
| 79 } | 79 } |
| 80 | 80 |
| 81 - (void)setFolderName:(NSString*)name { | 81 - (void)setFolderName:(NSString*)name { |
| 82 [nameField_ setStringValue:name]; | 82 [nameField_ setStringValue:name]; |
| 83 } | 83 } |
| 84 | 84 |
| 85 @end // BookmarkNameFolderController | 85 @end // BookmarkNameFolderController |
| OLD | NEW |