| 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 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" | 5 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" |
| 6 | 6 |
| 7 #include "base/mac/bundle_locations.h" | 7 #include "base/mac/bundle_locations.h" |
| 8 #include "base/mac/mac_util.h" | 8 #include "base/mac/mac_util.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 CGFloat padding = bookmarks::kNTPBookmarkBarPadding; | 477 CGFloat padding = bookmarks::kNTPBookmarkBarPadding; |
| 478 buttonViewFrame = | 478 buttonViewFrame = |
| 479 NSInsetRect(buttonViewFrame, morph * padding, morph * padding); | 479 NSInsetRect(buttonViewFrame, morph * padding, morph * padding); |
| 480 | 480 |
| 481 [buttonView_ setFrame:buttonViewFrame]; | 481 [buttonView_ setFrame:buttonViewFrame]; |
| 482 | 482 |
| 483 // Update bookmark button backgrounds. | 483 // Update bookmark button backgrounds. |
| 484 if ([self isAnimationRunning]) { | 484 if ([self isAnimationRunning]) { |
| 485 for (NSButton* button in buttons_.get()) | 485 for (NSButton* button in buttons_.get()) |
| 486 [button setNeedsDisplay:YES]; | 486 [button setNeedsDisplay:YES]; |
| 487 // Update the apps and other buttons explicitly, since they are not in the |
| 488 // buttons_ array. |
| 489 [appsPageShortcutButton_ setNeedsDisplay:YES]; |
| 490 [otherBookmarksButton_ setNeedsDisplay:YES]; |
| 487 } | 491 } |
| 488 } | 492 } |
| 489 | 493 |
| 490 // We don't change a preference; we only change visibility. Preference changing | 494 // We don't change a preference; we only change visibility. Preference changing |
| 491 // (global state) is handled in |chrome::ToggleBookmarkBarWhenVisible()|. We | 495 // (global state) is handled in |chrome::ToggleBookmarkBarWhenVisible()|. We |
| 492 // simply update based on what we're told. | 496 // simply update based on what we're told. |
| 493 - (void)updateVisibility { | 497 - (void)updateVisibility { |
| 494 [self showBookmarkBarWithAnimation:NO]; | 498 [self showBookmarkBarWithAnimation:NO]; |
| 495 } | 499 } |
| 496 | 500 |
| (...skipping 2177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2674 - (id<BookmarkButtonControllerProtocol>)controllerForNode: | 2678 - (id<BookmarkButtonControllerProtocol>)controllerForNode: |
| 2675 (const BookmarkNode*)node { | 2679 (const BookmarkNode*)node { |
| 2676 // See if it's in the bar, then if it is in the hierarchy of visible | 2680 // See if it's in the bar, then if it is in the hierarchy of visible |
| 2677 // folder menus. | 2681 // folder menus. |
| 2678 if (bookmarkModel_->bookmark_bar_node() == node) | 2682 if (bookmarkModel_->bookmark_bar_node() == node) |
| 2679 return self; | 2683 return self; |
| 2680 return [folderController_ controllerForNode:node]; | 2684 return [folderController_ controllerForNode:node]; |
| 2681 } | 2685 } |
| 2682 | 2686 |
| 2683 @end | 2687 @end |
| OLD | NEW |