| 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/extensions/browser_actions_controller.h" | 5 #import "chrome/browser/ui/cocoa/extensions/browser_actions_controller.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
| (...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 [containerView_ frame]; | 492 [containerView_ frame]; |
| 493 | 493 |
| 494 [self showChevronIfNecessaryInFrame:frame animate:animate]; | 494 [self showChevronIfNecessaryInFrame:frame animate:animate]; |
| 495 | 495 |
| 496 [containerView_ setNeedsDisplay:YES]; | 496 [containerView_ setNeedsDisplay:YES]; |
| 497 | 497 |
| 498 if (!animate) { | 498 if (!animate) { |
| 499 [[NSNotificationCenter defaultCenter] | 499 [[NSNotificationCenter defaultCenter] |
| 500 postNotificationName:kBrowserActionVisibilityChangedNotification | 500 postNotificationName:kBrowserActionVisibilityChangedNotification |
| 501 object:self]; | 501 object:self]; |
| 502 [self redraw]; | |
| 503 } | 502 } |
| 503 [self redraw]; |
| 504 } | 504 } |
| 505 | 505 |
| 506 - (BOOL)updateContainerVisibility { | 506 - (BOOL)updateContainerVisibility { |
| 507 BOOL hidden = [buttons_ count] == 0; | 507 BOOL hidden = [buttons_ count] == 0; |
| 508 if ([containerView_ isHidden] != hidden) | 508 if ([containerView_ isHidden] != hidden) |
| 509 [containerView_ setHidden:hidden]; | 509 [containerView_ setHidden:hidden]; |
| 510 return !hidden; | 510 return !hidden; |
| 511 } | 511 } |
| 512 | 512 |
| 513 - (void)updateButtonOpacity { | 513 - (void)updateButtonOpacity { |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 754 | 754 |
| 755 - (BrowserActionButton*)buttonWithIndex:(NSUInteger)index { | 755 - (BrowserActionButton*)buttonWithIndex:(NSUInteger)index { |
| 756 const std::vector<ToolbarActionViewController*>& toolbar_actions = | 756 const std::vector<ToolbarActionViewController*>& toolbar_actions = |
| 757 toolbarActionsBar_->toolbar_actions(); | 757 toolbarActionsBar_->toolbar_actions(); |
| 758 if (index < toolbar_actions.size()) | 758 if (index < toolbar_actions.size()) |
| 759 return [self buttonForId:toolbar_actions[index]->GetId()]; | 759 return [self buttonForId:toolbar_actions[index]->GetId()]; |
| 760 return nil; | 760 return nil; |
| 761 } | 761 } |
| 762 | 762 |
| 763 @end | 763 @end |
| OLD | NEW |