| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stack> | 5 #include <stack> |
| 6 | 6 |
| 7 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_editor_base_controller.h" | 7 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_editor_base_controller.h" |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 // adjust rect.origin.y to be the bottom of the toolbar | 278 // adjust rect.origin.y to be the bottom of the toolbar |
| 279 return rect; | 279 return rect; |
| 280 } | 280 } |
| 281 */ | 281 */ |
| 282 | 282 |
| 283 // TODO(jrg): consider NSModalSession. | 283 // TODO(jrg): consider NSModalSession. |
| 284 - (void)runAsModalSheet { | 284 - (void)runAsModalSheet { |
| 285 // Lock down floating bar when in full-screen mode. Don't animate | 285 // Lock down floating bar when in full-screen mode. Don't animate |
| 286 // otherwise the pane will be misplaced. | 286 // otherwise the pane will be misplaced. |
| 287 [[BrowserWindowController browserWindowControllerForWindow:parentWindow_] | 287 [[BrowserWindowController browserWindowControllerForWindow:parentWindow_] |
| 288 lockBarVisibilityForOwner:self withAnimation:NO delay:NO]; | 288 lockBarVisibilityForOwner:self |
| 289 withAnimation:NO]; |
| 289 [NSApp beginSheet:[self window] | 290 [NSApp beginSheet:[self window] |
| 290 modalForWindow:parentWindow_ | 291 modalForWindow:parentWindow_ |
| 291 modalDelegate:self | 292 modalDelegate:self |
| 292 didEndSelector:@selector(didEndSheet:returnCode:contextInfo:) | 293 didEndSelector:@selector(didEndSheet:returnCode:contextInfo:) |
| 293 contextInfo:nil]; | 294 contextInfo:nil]; |
| 294 } | 295 } |
| 295 | 296 |
| 296 // This constant has to match the name of the method after it. | 297 // This constant has to match the name of the method after it. |
| 297 NSString* const kOkEnabledName = @"okEnabled"; | 298 NSString* const kOkEnabledName = @"okEnabled"; |
| 298 - (BOOL)okEnabled { | 299 - (BOOL)okEnabled { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 325 | 326 |
| 326 - (IBAction)cancel:(id)sender { | 327 - (IBAction)cancel:(id)sender { |
| 327 [NSApp endSheet:[self window]]; | 328 [NSApp endSheet:[self window]]; |
| 328 } | 329 } |
| 329 | 330 |
| 330 - (void)didEndSheet:(NSWindow*)sheet | 331 - (void)didEndSheet:(NSWindow*)sheet |
| 331 returnCode:(int)returnCode | 332 returnCode:(int)returnCode |
| 332 contextInfo:(void*)contextInfo { | 333 contextInfo:(void*)contextInfo { |
| 333 [sheet close]; | 334 [sheet close]; |
| 334 [[BrowserWindowController browserWindowControllerForWindow:parentWindow_] | 335 [[BrowserWindowController browserWindowControllerForWindow:parentWindow_] |
| 335 releaseBarVisibilityForOwner:self withAnimation:YES delay:NO]; | 336 releaseBarVisibilityForOwner:self |
| 337 withAnimation:YES]; |
| 336 } | 338 } |
| 337 | 339 |
| 338 - (void)windowWillClose:(NSNotification*)notification { | 340 - (void)windowWillClose:(NSNotification*)notification { |
| 339 [self autorelease]; | 341 [self autorelease]; |
| 340 } | 342 } |
| 341 | 343 |
| 342 #pragma mark Folder Tree Management | 344 #pragma mark Folder Tree Management |
| 343 | 345 |
| 344 - (BookmarkModel*)bookmarkModel { | 346 - (BookmarkModel*)bookmarkModel { |
| 345 return BookmarkModelFactory::GetForBrowserContext(profile_); | 347 return BookmarkModelFactory::GetForBrowserContext(profile_); |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 [super dealloc]; | 729 [super dealloc]; |
| 728 } | 730 } |
| 729 | 731 |
| 730 // Implementing isEqual: allows the NSTreeController to preserve the selection | 732 // Implementing isEqual: allows the NSTreeController to preserve the selection |
| 731 // and open/shut state of outline items when the data changes. | 733 // and open/shut state of outline items when the data changes. |
| 732 - (BOOL)isEqual:(id)other { | 734 - (BOOL)isEqual:(id)other { |
| 733 return [other isKindOfClass:[BookmarkFolderInfo class]] && | 735 return [other isKindOfClass:[BookmarkFolderInfo class]] && |
| 734 folderNode_ == [(BookmarkFolderInfo*)other folderNode]; | 736 folderNode_ == [(BookmarkFolderInfo*)other folderNode]; |
| 735 } | 737 } |
| 736 @end | 738 @end |
| OLD | NEW |