| 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 #include "chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa.h" | 5 #include "chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa.h" |
| 6 | 6 |
| 7 #include "base/sys_string_conversions.h" | 7 #include "base/sys_string_conversions.h" |
| 8 #include "grit/generated_resources.h" | 8 #include "grit/generated_resources.h" |
| 9 #include "ui/base/l10n/l10n_util.h" | 9 #include "ui/base/l10n/l10n_util.h" |
| 10 | 10 |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 [new_checkbox setTarget:cocoa_controller_]; | 159 [new_checkbox setTarget:cocoa_controller_]; |
| 160 [new_checkbox setAction:@selector(onCheckboxToggled:)]; | 160 [new_checkbox setAction:@selector(onCheckboxToggled:)]; |
| 161 | 161 |
| 162 [checkbox_container_ addSubview:new_checkbox]; | 162 [checkbox_container_ addSubview:new_checkbox]; |
| 163 [checkboxes_ addObject:new_checkbox]; | 163 [checkboxes_ addObject:new_checkbox]; |
| 164 checkbox = new_checkbox.get(); | 164 checkbox = new_checkbox.get(); |
| 165 } | 165 } |
| 166 | 166 |
| 167 [checkbox setTitle:base::SysUTF16ToNSString(gallery->display_name)]; | 167 [checkbox setTitle:base::SysUTF16ToNSString(gallery->display_name)]; |
| 168 [checkbox setToolTip: | 168 [checkbox setToolTip: |
| 169 base::SysUTF16ToNSString(gallery->path.LossyDisplayName())]; | 169 base::SysUTF16ToNSString(gallery->AbsolutePath().LossyDisplayName())]; |
| 170 [checkbox setState:permitted ? NSOnState : NSOffState]; | 170 [checkbox setState:permitted ? NSOnState : NSOffState]; |
| 171 | 171 |
| 172 [checkbox sizeToFit]; | 172 [checkbox sizeToFit]; |
| 173 NSRect rect = [checkbox bounds]; | 173 NSRect rect = [checkbox bounds]; |
| 174 rect.origin.y = y_pos; | 174 rect.origin.y = y_pos; |
| 175 rect.size.width = std::min(NSWidth(rect), kCheckboxMaxWidth); | 175 rect.size.width = std::min(NSWidth(rect), kCheckboxMaxWidth); |
| 176 [checkbox setFrame:rect]; | 176 [checkbox setFrame:rect]; |
| 177 } | 177 } |
| 178 | 178 |
| 179 void MediaGalleriesDialogCocoa::UpdateCheckboxContainerFrame() { | 179 void MediaGalleriesDialogCocoa::UpdateCheckboxContainerFrame() { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 | 211 |
| 212 // static | 212 // static |
| 213 MediaGalleriesDialog* MediaGalleriesDialog::Create( | 213 MediaGalleriesDialog* MediaGalleriesDialog::Create( |
| 214 MediaGalleriesDialogController* controller) { | 214 MediaGalleriesDialogController* controller) { |
| 215 scoped_nsobject<MediaGalleriesCocoaController> cocoa_controller( | 215 scoped_nsobject<MediaGalleriesCocoaController> cocoa_controller( |
| 216 [[MediaGalleriesCocoaController alloc] init]); | 216 [[MediaGalleriesCocoaController alloc] init]); |
| 217 return new MediaGalleriesDialogCocoa(controller, cocoa_controller); | 217 return new MediaGalleriesDialogCocoa(controller, cocoa_controller); |
| 218 } | 218 } |
| 219 | 219 |
| 220 } // namespace chrome | 220 } // namespace chrome |
| OLD | NEW |