| 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/panels/panel_titlebar_view_cocoa.h" | 5 #import "chrome/browser/ui/panels/panel_titlebar_view_cocoa.h" |
| 6 | 6 |
| 7 #include <Carbon/Carbon.h> // kVK_Escape | 7 #include <Carbon/Carbon.h> // kVK_Escape |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 NSWidth(rootViewBounds), | 302 NSWidth(rootViewBounds), |
| 303 titlebarSize.height); | 303 titlebarSize.height); |
| 304 [self setFrame:titlebarFrame]; | 304 [self setFrame:titlebarFrame]; |
| 305 | 305 |
| 306 [title_ setFont:[NSFont fontWithName:@"Arial" size:14.0]]; | 306 [title_ setFont:[NSFont fontWithName:@"Arial" size:14.0]]; |
| 307 [title_ setDrawsBackground:NO]; | 307 [title_ setDrawsBackground:NO]; |
| 308 | 308 |
| 309 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 309 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 310 | 310 |
| 311 [self initializeImageButton:customCloseButton_ | 311 [self initializeImageButton:customCloseButton_ |
| 312 image: rb.GetNativeImageNamed(IDR_PANEL_CLOSE) | 312 image:rb.GetNativeImageNamed(IDR_PANEL_CLOSE).ToNSImage() |
| 313 hoverImage:rb.GetNativeImageNamed(IDR_PANEL_CLOSE_H) | 313 hoverImage:rb.GetNativeImageNamed(IDR_PANEL_CLOSE_H).ToNSImage() |
| 314 pressedImage:rb.GetNativeImageNamed(IDR_PANEL_CLOSE_C) | 314 pressedImage:rb.GetNativeImageNamed(IDR_PANEL_CLOSE_C).ToNSImage() |
| 315 toolTip:l10n_util::GetNSStringWithFixup(IDS_PANEL_CLOSE_TOOLTIP)]; | 315 toolTip:l10n_util::GetNSStringWithFixup(IDS_PANEL_CLOSE_TOOLTIP)]; |
| 316 | 316 |
| 317 // Iniitalize the minimize and restore buttons. | 317 // Iniitalize the minimize and restore buttons. |
| 318 [self initializeImageButton:minimizeButton_ | 318 [self initializeImageButton:minimizeButton_ |
| 319 image:rb.GetNativeImageNamed(IDR_PANEL_MINIMIZE) | 319 image:rb.GetNativeImageNamed(IDR_PANEL_MINIMIZE).ToNSImage() |
| 320 hoverImage:rb.GetNativeImageNamed(IDR_PANEL_MINIMIZE_H) | 320 hoverImage:rb.GetNativeImageNamed(IDR_PANEL_MINIMIZE_H).ToNSImage() |
| 321 pressedImage:rb.GetNativeImageNamed(IDR_PANEL_MINIMIZE_C) | 321 pressedImage:rb.GetNativeImageNamed(IDR_PANEL_MINIMIZE_C).ToNSImage() |
| 322 toolTip:l10n_util::GetNSStringWithFixup(IDS_PANEL_MINIMIZE_TOOLTIP)]; | 322 toolTip:l10n_util::GetNSStringWithFixup(IDS_PANEL_MINIMIZE_TOOLTIP)]; |
| 323 | 323 |
| 324 [self initializeImageButton:restoreButton_ | 324 [self initializeImageButton:restoreButton_ |
| 325 image: rb.GetNativeImageNamed(IDR_PANEL_RESTORE) | 325 image:rb.GetNativeImageNamed(IDR_PANEL_RESTORE).ToNSImage() |
| 326 hoverImage:rb.GetNativeImageNamed(IDR_PANEL_RESTORE_H) | 326 hoverImage:rb.GetNativeImageNamed(IDR_PANEL_RESTORE_H).ToNSImage() |
| 327 pressedImage:rb.GetNativeImageNamed(IDR_PANEL_RESTORE_C) | 327 pressedImage:rb.GetNativeImageNamed(IDR_PANEL_RESTORE_C).ToNSImage() |
| 328 toolTip:l10n_util::GetNSStringWithFixup(IDS_PANEL_RESTORE_TOOLTIP)]; | 328 toolTip:l10n_util::GetNSStringWithFixup(IDS_PANEL_RESTORE_TOOLTIP)]; |
| 329 | 329 |
| 330 [controller_ updateTitleBarMinimizeRestoreButtonVisibility]; | 330 [controller_ updateTitleBarMinimizeRestoreButtonVisibility]; |
| 331 | 331 |
| 332 [self updateCustomButtonsLayout]; | 332 [self updateCustomButtonsLayout]; |
| 333 | 333 |
| 334 // Set autoresizing behavior: glued to edges on left, top and right. | 334 // Set autoresizing behavior: glued to edges on left, top and right. |
| 335 [self setAutoresizingMask:(NSViewMinYMargin | NSViewWidthSizable)]; | 335 [self setAutoresizingMask:(NSViewMinYMargin | NSViewWidthSizable)]; |
| 336 | 336 |
| 337 [[NSNotificationCenter defaultCenter] | 337 [[NSNotificationCenter defaultCenter] |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 683 - (NSButton*)minimizeButton { | 683 - (NSButton*)minimizeButton { |
| 684 return minimizeButton_; | 684 return minimizeButton_; |
| 685 } | 685 } |
| 686 | 686 |
| 687 - (NSButton*)restoreButton { | 687 - (NSButton*)restoreButton { |
| 688 return restoreButton_; | 688 return restoreButton_; |
| 689 } | 689 } |
| 690 | 690 |
| 691 @end | 691 @end |
| 692 | 692 |
| OLD | NEW |