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 | 288 lockToolbarVisibilityForOwner:self |
289 withAnimation:NO]; | 289 withAnimation:NO]; |
290 [NSApp beginSheet:[self window] | 290 [NSApp beginSheet:[self window] |
291 modalForWindow:parentWindow_ | 291 modalForWindow:parentWindow_ |
292 modalDelegate:self | 292 modalDelegate:self |
293 didEndSelector:@selector(didEndSheet:returnCode:contextInfo:) | 293 didEndSelector:@selector(didEndSheet:returnCode:contextInfo:) |
294 contextInfo:nil]; | 294 contextInfo:nil]; |
295 } | 295 } |
296 | 296 |
297 // 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. |
298 NSString* const kOkEnabledName = @"okEnabled"; | 298 NSString* const kOkEnabledName = @"okEnabled"; |
299 - (BOOL)okEnabled { | 299 - (BOOL)okEnabled { |
(...skipping 26 matching lines...) Expand all Loading... |
326 | 326 |
327 - (IBAction)cancel:(id)sender { | 327 - (IBAction)cancel:(id)sender { |
328 [NSApp endSheet:[self window]]; | 328 [NSApp endSheet:[self window]]; |
329 } | 329 } |
330 | 330 |
331 - (void)didEndSheet:(NSWindow*)sheet | 331 - (void)didEndSheet:(NSWindow*)sheet |
332 returnCode:(int)returnCode | 332 returnCode:(int)returnCode |
333 contextInfo:(void*)contextInfo { | 333 contextInfo:(void*)contextInfo { |
334 [sheet close]; | 334 [sheet close]; |
335 [[BrowserWindowController browserWindowControllerForWindow:parentWindow_] | 335 [[BrowserWindowController browserWindowControllerForWindow:parentWindow_] |
336 releaseBarVisibilityForOwner:self | 336 releaseToolbarVisibilityForOwner:self |
337 withAnimation:YES]; | 337 withAnimation:YES]; |
338 } | 338 } |
339 | 339 |
340 - (void)windowWillClose:(NSNotification*)notification { | 340 - (void)windowWillClose:(NSNotification*)notification { |
341 [self autorelease]; | 341 [self autorelease]; |
342 } | 342 } |
343 | 343 |
344 #pragma mark Folder Tree Management | 344 #pragma mark Folder Tree Management |
345 | 345 |
346 - (BookmarkModel*)bookmarkModel { | 346 - (BookmarkModel*)bookmarkModel { |
347 return BookmarkModelFactory::GetForBrowserContext(profile_); | 347 return BookmarkModelFactory::GetForBrowserContext(profile_); |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
729 [super dealloc]; | 729 [super dealloc]; |
730 } | 730 } |
731 | 731 |
732 // Implementing isEqual: allows the NSTreeController to preserve the selection | 732 // Implementing isEqual: allows the NSTreeController to preserve the selection |
733 // and open/shut state of outline items when the data changes. | 733 // and open/shut state of outline items when the data changes. |
734 - (BOOL)isEqual:(id)other { | 734 - (BOOL)isEqual:(id)other { |
735 return [other isKindOfClass:[BookmarkFolderInfo class]] && | 735 return [other isKindOfClass:[BookmarkFolderInfo class]] && |
736 folderNode_ == [(BookmarkFolderInfo*)other folderNode]; | 736 folderNode_ == [(BookmarkFolderInfo*)other folderNode]; |
737 } | 737 } |
738 @end | 738 @end |
OLD | NEW |