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 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
475 // The state of our morph (if any); 1 is total bubble, 0 is the regular bar. | 475 // The state of our morph (if any); 1 is total bubble, 0 is the regular bar. |
476 CGFloat morph = [self detachedMorphProgress]; | 476 CGFloat morph = [self detachedMorphProgress]; |
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 [appsPageShortcutButton_ setNeedsDisplay:YES]; | |
486 [otherBookmarksButton_ setNeedsDisplay:YES]; | |
Avi (use Gerrit)
2014/03/06 03:42:48
Explain with a brief comment?
ccameron
2014/03/06 07:06:55
Done.
| |
485 for (NSButton* button in buttons_.get()) | 487 for (NSButton* button in buttons_.get()) |
486 [button setNeedsDisplay:YES]; | 488 [button setNeedsDisplay:YES]; |
487 } | 489 } |
488 } | 490 } |
489 | 491 |
490 // We don't change a preference; we only change visibility. Preference changing | 492 // We don't change a preference; we only change visibility. Preference changing |
491 // (global state) is handled in |chrome::ToggleBookmarkBarWhenVisible()|. We | 493 // (global state) is handled in |chrome::ToggleBookmarkBarWhenVisible()|. We |
492 // simply update based on what we're told. | 494 // simply update based on what we're told. |
493 - (void)updateVisibility { | 495 - (void)updateVisibility { |
494 [self showBookmarkBarWithAnimation:NO]; | 496 [self showBookmarkBarWithAnimation:NO]; |
(...skipping 2179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2674 - (id<BookmarkButtonControllerProtocol>)controllerForNode: | 2676 - (id<BookmarkButtonControllerProtocol>)controllerForNode: |
2675 (const BookmarkNode*)node { | 2677 (const BookmarkNode*)node { |
2676 // See if it's in the bar, then if it is in the hierarchy of visible | 2678 // See if it's in the bar, then if it is in the hierarchy of visible |
2677 // folder menus. | 2679 // folder menus. |
2678 if (bookmarkModel_->bookmark_bar_node() == node) | 2680 if (bookmarkModel_->bookmark_bar_node() == node) |
2679 return self; | 2681 return self; |
2680 return [folderController_ controllerForNode:node]; | 2682 return [folderController_ controllerForNode:node]; |
2681 } | 2683 } |
2682 | 2684 |
2683 @end | 2685 @end |
OLD | NEW |