| 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/app_menu/app_menu_controller.h" | 5 #import "chrome/browser/ui/cocoa/app_menu/app_menu_controller.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/mac/bundle_locations.h" | 10 #include "base/mac/bundle_locations.h" |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 | 106 |
| 107 private: | 107 private: |
| 108 void OnZoomLevelChanged(const content::HostZoomMap::ZoomLevelChange& change) { | 108 void OnZoomLevelChanged(const content::HostZoomMap::ZoomLevelChange& change) { |
| 109 AppMenuModel* appMenuModel = [controller_ appMenuModel]; | 109 AppMenuModel* appMenuModel = [controller_ appMenuModel]; |
| 110 appMenuModel->UpdateZoomControls(); | 110 appMenuModel->UpdateZoomControls(); |
| 111 const base::string16 level = | 111 const base::string16 level = |
| 112 appMenuModel->GetLabelForCommandId(IDC_ZOOM_PERCENT_DISPLAY); | 112 appMenuModel->GetLabelForCommandId(IDC_ZOOM_PERCENT_DISPLAY); |
| 113 [[controller_ zoomDisplay] setTitle:SysUTF16ToNSString(level)]; | 113 [[controller_ zoomDisplay] setTitle:SysUTF16ToNSString(level)]; |
| 114 } | 114 } |
| 115 | 115 |
| 116 scoped_ptr<content::HostZoomMap::Subscription> subscription_; | 116 std::unique_ptr<content::HostZoomMap::Subscription> subscription_; |
| 117 | 117 |
| 118 AppMenuController* controller_; // Weak; owns this. | 118 AppMenuController* controller_; // Weak; owns this. |
| 119 | 119 |
| 120 DISALLOW_COPY_AND_ASSIGN(ZoomLevelObserver); | 120 DISALLOW_COPY_AND_ASSIGN(ZoomLevelObserver); |
| 121 }; | 121 }; |
| 122 | 122 |
| 123 class ToolbarActionsBarObserverHelper : public ToolbarActionsBarObserver { | 123 class ToolbarActionsBarObserverHelper : public ToolbarActionsBarObserver { |
| 124 public: | 124 public: |
| 125 ToolbarActionsBarObserverHelper(AppMenuController* controller, | 125 ToolbarActionsBarObserverHelper(AppMenuController* controller, |
| 126 ToolbarActionsBar* toolbar_actions_bar) | 126 ToolbarActionsBar* toolbar_actions_bar) |
| (...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 626 // (and thus, after all our ability to adjust it normally). Throw in the | 626 // (and thus, after all our ability to adjust it normally). Throw in the |
| 627 // towel, and simply don't let the frame move from where it's supposed to be. | 627 // towel, and simply don't let the frame move from where it's supposed to be. |
| 628 // TODO(devlin): Yet another Cocoa hack. It'd be good to find a workaround, | 628 // TODO(devlin): Yet another Cocoa hack. It'd be good to find a workaround, |
| 629 // but unlikely unless we replace the Cocoa menu implementation. | 629 // but unlikely unless we replace the Cocoa menu implementation. |
| 630 NSView* containerSuperview = [overflowActionsContainerView_ superview]; | 630 NSView* containerSuperview = [overflowActionsContainerView_ superview]; |
| 631 if (NSMinX([containerSuperview frame]) != 0) | 631 if (NSMinX([containerSuperview frame]) != 0) |
| 632 [containerSuperview setFrameOrigin:NSZeroPoint]; | 632 [containerSuperview setFrameOrigin:NSZeroPoint]; |
| 633 } | 633 } |
| 634 | 634 |
| 635 @end // @implementation AppMenuButtonViewController | 635 @end // @implementation AppMenuButtonViewController |
| OLD | NEW |