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

Side by Side Diff: chrome/browser/cocoa/bookmark_bar_controller.mm

Issue 495010: Mac: fix/implement app windows (not app mode), popups, drawing; refactor code. (Closed)
Patch Set: Updated per pink's review. Created 11 years 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
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 #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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/autocomplete_text_field_cell.mm ('k') | chrome/browser/cocoa/browser_window_cocoa.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698