Chromium Code Reviews| 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 1368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1379 } | 1379 } |
| 1380 | 1380 |
| 1381 // (Private) | 1381 // (Private) |
| 1382 - (void)finalizeState { | 1382 - (void)finalizeState { |
| 1383 // We promise that our delegate that the variables will be finalized before | 1383 // We promise that our delegate that the variables will be finalized before |
| 1384 // the call to |-bookmarkBar:didChangeFromState:toState:|. | 1384 // the call to |-bookmarkBar:didChangeFromState:toState:|. |
| 1385 BookmarkBar::State oldState = lastState_; | 1385 BookmarkBar::State oldState = lastState_; |
| 1386 lastState_ = currentState_; | 1386 lastState_ = currentState_; |
| 1387 isAnimationRunning_ = NO; | 1387 isAnimationRunning_ = NO; |
| 1388 | 1388 |
| 1389 // Update ourselves visually. | |
| 1390 [self updateVisibility]; | |
| 1391 | |
| 1389 // Notify our delegate. | 1392 // Notify our delegate. |
| 1390 [delegate_ bookmarkBar:self | 1393 [delegate_ bookmarkBar:self |
| 1391 didChangeFromState:oldState | 1394 didChangeFromState:oldState |
| 1392 toState:currentState_]; | 1395 toState:currentState_]; |
|
Malcolm
2014/08/08 10:51:51
We should guarantee everything is done before noti
| |
| 1393 | |
| 1394 // Update ourselves visually. | |
| 1395 [self updateVisibility]; | |
| 1396 } | 1396 } |
| 1397 | 1397 |
| 1398 // (Private) | 1398 // (Private) |
| 1399 - (void)stopCurrentAnimation { | 1399 - (void)stopCurrentAnimation { |
| 1400 [[self animatableView] stopAnimation]; | 1400 [[self animatableView] stopAnimation]; |
| 1401 } | 1401 } |
| 1402 | 1402 |
| 1403 // Delegate method for |AnimatableView| (a superclass of | 1403 // Delegate method for |AnimatableView| (a superclass of |
| 1404 // |BookmarkBarToolbarView|). | 1404 // |BookmarkBarToolbarView|). |
| 1405 - (void)animationDidEnd:(NSAnimation*)animation { | 1405 - (void)animationDidEnd:(NSAnimation*)animation { |
| (...skipping 1391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2797 - (id<BookmarkButtonControllerProtocol>)controllerForNode: | 2797 - (id<BookmarkButtonControllerProtocol>)controllerForNode: |
| 2798 (const BookmarkNode*)node { | 2798 (const BookmarkNode*)node { |
| 2799 // See if it's in the bar, then if it is in the hierarchy of visible | 2799 // See if it's in the bar, then if it is in the hierarchy of visible |
| 2800 // folder menus. | 2800 // folder menus. |
| 2801 if (bookmarkModel_->bookmark_bar_node() == node) | 2801 if (bookmarkModel_->bookmark_bar_node() == node) |
| 2802 return self; | 2802 return self; |
| 2803 return [folderController_ controllerForNode:node]; | 2803 return [folderController_ controllerForNode:node]; |
| 2804 } | 2804 } |
| 2805 | 2805 |
| 2806 @end | 2806 @end |
| OLD | NEW |