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 "app/l10n_util_mac.h" | 5 #include "app/l10n_util_mac.h" |
6 #include "app/resource_bundle.h" | 6 #include "app/resource_bundle.h" |
7 #include "base/mac_util.h" | 7 #include "base/mac_util.h" |
8 #include "base/sys_string_conversions.h" | 8 #include "base/sys_string_conversions.h" |
9 #include "chrome/browser/bookmarks/bookmark_editor.h" | 9 #include "chrome/browser/bookmarks/bookmark_editor.h" |
10 #include "chrome/browser/bookmarks/bookmark_model.h" | 10 #include "chrome/browser/bookmarks/bookmark_model.h" |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 } | 445 } |
446 | 446 |
447 // We don't change a preference; we only change visibility. Preference changing | 447 // We don't change a preference; we only change visibility. Preference changing |
448 // (global state) is handled in |BrowserWindowCocoa::ToggleBookmarkBar()|. We | 448 // (global state) is handled in |BrowserWindowCocoa::ToggleBookmarkBar()|. We |
449 // simply update based on what we're told. | 449 // simply update based on what we're told. |
450 - (void)updateVisibility { | 450 - (void)updateVisibility { |
451 [self showBookmarkBarWithAnimation:NO]; | 451 [self showBookmarkBarWithAnimation:NO]; |
452 } | 452 } |
453 | 453 |
454 - (void)setBookmarkBarEnabled:(BOOL)enabled { | 454 - (void)setBookmarkBarEnabled:(BOOL)enabled { |
455 barIsEnabled_ = enabled; | 455 if (enabled != barIsEnabled_) { |
456 [self updateVisibility]; | 456 barIsEnabled_ = enabled; |
| 457 [self updateVisibility]; |
| 458 } |
457 } | 459 } |
458 | 460 |
459 - (CGFloat)getDesiredToolbarHeightCompression { | 461 - (CGFloat)getDesiredToolbarHeightCompression { |
460 // Some special cases.... | 462 // Some special cases.... |
461 if (!barIsEnabled_) | 463 if (!barIsEnabled_) |
462 return 0; | 464 return 0; |
463 | 465 |
464 if ([self isAnimationRunning]) { | 466 if ([self isAnimationRunning]) { |
465 // No toolbar compression when animating between hidden and showing, nor | 467 // No toolbar compression when animating between hidden and showing, nor |
466 // between showing and detached. | 468 // between showing and detached. |
(...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1504 [pboard addTypes:[NSArray arrayWithObject:kBookmarkButtonDragType] | 1506 [pboard addTypes:[NSArray arrayWithObject:kBookmarkButtonDragType] |
1505 owner:nil]; | 1507 owner:nil]; |
1506 [pboard setData:[NSData dataWithBytes:&button length:sizeof(button)] | 1508 [pboard setData:[NSData dataWithBytes:&button length:sizeof(button)] |
1507 forType:kBookmarkButtonDragType]; | 1509 forType:kBookmarkButtonDragType]; |
1508 } else { | 1510 } else { |
1509 NOTREACHED(); | 1511 NOTREACHED(); |
1510 } | 1512 } |
1511 } | 1513 } |
1512 | 1514 |
1513 @end | 1515 @end |
OLD | NEW |