| 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 <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 // Make sure the button is within the visible container. | 507 // Make sure the button is within the visible container. |
| 508 if ([button superview] != containerView_) { | 508 if ([button superview] != containerView_) { |
| 509 // We add the subview under the sibling views so that when it | 509 // We add the subview under the sibling views so that when it |
| 510 // "slides in", it does so under its neighbors. | 510 // "slides in", it does so under its neighbors. |
| 511 [containerView_ addSubview:button | 511 [containerView_ addSubview:button |
| 512 positioned:NSWindowBelow | 512 positioned:NSWindowBelow |
| 513 relativeTo:nil]; | 513 relativeTo:nil]; |
| 514 } | 514 } |
| 515 // We need to set the alpha value in case the container has resized. | 515 // We need to set the alpha value in case the container has resized. |
| 516 [button setAlphaValue:1.0]; | 516 [button setAlphaValue:1.0]; |
| 517 } else if ([button superview] == containerView_) { | 517 } else if ([button superview] == containerView_ && |
| 518 ![containerView_ userIsResizing]) { |
| 519 // If the user is resizing, all buttons are (and should be) on the |
| 520 // container view. |
| 518 [button removeFromSuperview]; | 521 [button removeFromSuperview]; |
| 519 [button setAlphaValue:0.0]; | 522 [button setAlphaValue:0.0]; |
| 520 } | 523 } |
| 521 } | 524 } |
| 522 } | 525 } |
| 523 | 526 |
| 524 - (void)removeViewForAction:(ToolbarActionViewController*)action { | 527 - (void)removeViewForAction:(ToolbarActionViewController*)action { |
| 525 BrowserActionButton* button = [self buttonForId:action->GetId()]; | 528 BrowserActionButton* button = [self buttonForId:action->GetId()]; |
| 526 | 529 |
| 527 [button removeFromSuperview]; | 530 [button removeFromSuperview]; |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 868 - (ToolbarActionsBar*)toolbarActionsBar { | 871 - (ToolbarActionsBar*)toolbarActionsBar { |
| 869 return toolbarActionsBar_.get(); | 872 return toolbarActionsBar_.get(); |
| 870 } | 873 } |
| 871 | 874 |
| 872 + (BrowserActionsController*)fromToolbarActionsBarDelegate: | 875 + (BrowserActionsController*)fromToolbarActionsBarDelegate: |
| 873 (ToolbarActionsBarDelegate*)delegate { | 876 (ToolbarActionsBarDelegate*)delegate { |
| 874 return static_cast<ToolbarActionsBarBridge*>(delegate)->controller_for_test(); | 877 return static_cast<ToolbarActionsBarBridge*>(delegate)->controller_for_test(); |
| 875 } | 878 } |
| 876 | 879 |
| 877 @end | 880 @end |
| OLD | NEW |