OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/wrench_menu/wrench_menu_controller.h" | 5 #import "chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/mac/bundle_locations.h" | 8 #include "base/mac/bundle_locations.h" |
9 #include "base/scoped_observer.h" | 9 #include "base/scoped_observer.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 @synthesize zoomPlus = zoomPlus_; | 566 @synthesize zoomPlus = zoomPlus_; |
567 @synthesize zoomDisplay = zoomDisplay_; | 567 @synthesize zoomDisplay = zoomDisplay_; |
568 @synthesize zoomMinus = zoomMinus_; | 568 @synthesize zoomMinus = zoomMinus_; |
569 @synthesize zoomFullScreen = zoomFullScreen_; | 569 @synthesize zoomFullScreen = zoomFullScreen_; |
570 @synthesize toolbarActionsOverflowItem = toolbarActionsOverflowItem_; | 570 @synthesize toolbarActionsOverflowItem = toolbarActionsOverflowItem_; |
571 @synthesize overflowActionsContainerView = overflowActionsContainerView_; | 571 @synthesize overflowActionsContainerView = overflowActionsContainerView_; |
572 | 572 |
573 - (id)initWithController:(WrenchMenuController*)controller { | 573 - (id)initWithController:(WrenchMenuController*)controller { |
574 if ((self = [super initWithNibName:@"WrenchMenu" | 574 if ((self = [super initWithNibName:@"WrenchMenu" |
575 bundle:base::mac::FrameworkBundle()])) { | 575 bundle:base::mac::FrameworkBundle()])) { |
| 576 propertyReleaser_.Init(self, [WrenchMenuButtonViewController class]); |
576 controller_ = controller; | 577 controller_ = controller; |
577 [[NSNotificationCenter defaultCenter] | 578 [[NSNotificationCenter defaultCenter] |
578 addObserver:self | 579 addObserver:self |
579 selector:@selector(containerSuperviewFrameChanged:) | 580 selector:@selector(containerSuperviewFrameChanged:) |
580 name:NSViewFrameDidChangeNotification | 581 name:NSViewFrameDidChangeNotification |
581 object:[overflowActionsContainerView_ superview]]; | 582 object:[overflowActionsContainerView_ superview]]; |
582 } | 583 } |
583 return self; | 584 return self; |
584 } | 585 } |
585 | 586 |
(...skipping 14 matching lines...) Expand all Loading... |
600 // (and thus, after all our ability to adjust it normally). Throw in the | 601 // (and thus, after all our ability to adjust it normally). Throw in the |
601 // towel, and simply don't let the frame move from where it's supposed to be. | 602 // towel, and simply don't let the frame move from where it's supposed to be. |
602 // TODO(devlin): Yet another Cocoa hack. It'd be good to find a workaround, | 603 // TODO(devlin): Yet another Cocoa hack. It'd be good to find a workaround, |
603 // but unlikely unless we replace the Cocoa menu implementation. | 604 // but unlikely unless we replace the Cocoa menu implementation. |
604 NSView* containerSuperview = [overflowActionsContainerView_ superview]; | 605 NSView* containerSuperview = [overflowActionsContainerView_ superview]; |
605 if (NSMinX([containerSuperview frame]) != 0) | 606 if (NSMinX([containerSuperview frame]) != 0) |
606 [containerSuperview setFrameOrigin:NSZeroPoint]; | 607 [containerSuperview setFrameOrigin:NSZeroPoint]; |
607 } | 608 } |
608 | 609 |
609 @end // @implementation WrenchMenuButtonViewController | 610 @end // @implementation WrenchMenuButtonViewController |
OLD | NEW |