| 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/extension_install_view_controller.h" | 5 #import "chrome/browser/ui/cocoa/extensions/extension_install_view_controller.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/i18n/rtl.h" | 8 #include "base/i18n/rtl.h" |
| 9 #include "base/mac/bundle_locations.h" | 9 #include "base/mac/bundle_locations.h" |
| 10 #include "base/mac/mac_util.h" | 10 #include "base/mac/mac_util.h" |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 | 270 |
| 271 - (IBAction)cancel:(id)sender { | 271 - (IBAction)cancel:(id)sender { |
| 272 delegate_->InstallUIAbort(/*user_initiated=*/true); | 272 delegate_->InstallUIAbort(/*user_initiated=*/true); |
| 273 } | 273 } |
| 274 | 274 |
| 275 - (IBAction)ok:(id)sender { | 275 - (IBAction)ok:(id)sender { |
| 276 delegate_->InstallUIProceed(); | 276 delegate_->InstallUIProceed(); |
| 277 } | 277 } |
| 278 | 278 |
| 279 - (void)awakeFromNib { | 279 - (void)awakeFromNib { |
| 280 // Since linking to 10.10, |outlineView_| needs an explicit background to |
| 281 // ensure subpixel antialiasing is enabled for the permissions text. At the |
| 282 // same time, the animation that shows the prompt breaks whenever the scroll |
| 283 // view is present. Giving the scroll view a layer restores the animation, and |
| 284 // since its contents has an opaque background, subpixel AA isn't affected. |
| 285 [[outlineView_ enclosingScrollView] setWantsLayer:YES]; |
| 286 [outlineView_ setBackgroundColor:[NSColor whiteColor]]; |
| 287 |
| 280 // Set control labels. | 288 // Set control labels. |
| 281 [titleField_ setStringValue:base::SysUTF16ToNSString( | 289 [titleField_ setStringValue:base::SysUTF16ToNSString( |
| 282 prompt_->GetDialogTitle())]; | 290 prompt_->GetDialogTitle())]; |
| 283 NSRect okButtonRect; | 291 NSRect okButtonRect; |
| 284 base::string16 acceptButtonLabel = prompt_->GetAcceptButtonLabel(); | 292 base::string16 acceptButtonLabel = prompt_->GetAcceptButtonLabel(); |
| 285 if (!acceptButtonLabel.empty()) { | 293 if (!acceptButtonLabel.empty()) { |
| 286 [okButton_ setTitle:base::SysUTF16ToNSString(acceptButtonLabel)]; | 294 [okButton_ setTitle:base::SysUTF16ToNSString(acceptButtonLabel)]; |
| 287 } else { | 295 } else { |
| 288 [okButton_ removeFromSuperview]; | 296 [okButton_ removeFromSuperview]; |
| 289 okButtonRect = [okButton_ frame]; | 297 okButtonRect = [okButton_ frame]; |
| (...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 844 } | 852 } |
| 845 | 853 |
| 846 - (void)accessibilityPerformAction:(NSString*)action { | 854 - (void)accessibilityPerformAction:(NSString*)action { |
| 847 if ([action isEqualToString:NSAccessibilityPressAction]) | 855 if ([action isEqualToString:NSAccessibilityPressAction]) |
| 848 [self handleLinkClicked]; | 856 [self handleLinkClicked]; |
| 849 else | 857 else |
| 850 [super accessibilityPerformAction:action]; | 858 [super accessibilityPerformAction:action]; |
| 851 } | 859 } |
| 852 | 860 |
| 853 @end | 861 @end |
| OLD | NEW |