| 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/mac/scoped_nsobject.h" | 7 #include "base/mac/scoped_nsobject.h" |
| 8 #include "base/strings/sys_string_conversions.h" | 8 #include "base/strings/sys_string_conversions.h" |
| 9 #include "chrome/browser/ui/chrome_style.h" | 9 #include "chrome/browser/ui/chrome_style.h" |
| 10 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_alert.h" | 10 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_alert.h" |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 CGFloat MediaGalleriesDialogCocoa::CreateCheckboxes( | 179 CGFloat MediaGalleriesDialogCocoa::CreateCheckboxes( |
| 180 CGFloat y_pos, | 180 CGFloat y_pos, |
| 181 const MediaGalleriesDialogController::Entries& entries) { | 181 const MediaGalleriesDialogController::Entries& entries) { |
| 182 for (MediaGalleriesDialogController::Entries::const_iterator iter = | 182 for (MediaGalleriesDialogController::Entries::const_iterator iter = |
| 183 entries.begin(); iter != entries.end(); ++iter) { | 183 entries.begin(); iter != entries.end(); ++iter) { |
| 184 const MediaGalleriesDialogController::Entry& entry = *iter; | 184 const MediaGalleriesDialogController::Entry& entry = *iter; |
| 185 base::scoped_nsobject<MediaGalleryListEntry> checkbox_entry( | 185 base::scoped_nsobject<MediaGalleryListEntry> checkbox_entry( |
| 186 [[MediaGalleryListEntry alloc] | 186 [[MediaGalleryListEntry alloc] |
| 187 initWithFrame:NSZeroRect | 187 initWithFrame:NSZeroRect |
| 188 controller:this | 188 controller:this |
| 189 prefId:entry.pref_info.pref_id | 189 prefInfo:entry.pref_info |
| 190 galleryName:entry.pref_info.GetGalleryDisplayName() | 190 showFolderViewer:controller_->ShouldShowFolderViewer(entry)]); |
| 191 subscript:entry.pref_info.GetGalleryAdditionalDetails() | |
| 192 tooltip:entry.pref_info.GetGalleryTooltip() | |
| 193 showFolderViewer:controller_->ShouldShowFolderViewer(entry)]); | |
| 194 | 191 |
| 195 [checkbox_entry setState:entry.selected]; | 192 [checkbox_entry setState:entry.selected]; |
| 196 | 193 |
| 197 [checkbox_entry setFrameOrigin:NSMakePoint(0, y_pos)]; | 194 [checkbox_entry setFrameOrigin:NSMakePoint(0, y_pos)]; |
| 198 y_pos = NSMaxY([checkbox_entry frame]) + kCheckboxMargin; | 195 y_pos = NSMaxY([checkbox_entry frame]) + kCheckboxMargin; |
| 199 | 196 |
| 200 [checkbox_container_ addSubview:checkbox_entry]; | 197 [checkbox_container_ addSubview:checkbox_entry]; |
| 201 } | 198 } |
| 202 | 199 |
| 203 return y_pos; | 200 return y_pos; |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 return controller_->GetContextMenu(pref_id); | 277 return controller_->GetContextMenu(pref_id); |
| 281 } | 278 } |
| 282 | 279 |
| 283 // static | 280 // static |
| 284 MediaGalleriesDialog* MediaGalleriesDialog::Create( | 281 MediaGalleriesDialog* MediaGalleriesDialog::Create( |
| 285 MediaGalleriesDialogController* controller) { | 282 MediaGalleriesDialogController* controller) { |
| 286 base::scoped_nsobject<MediaGalleriesCocoaController> cocoa_controller( | 283 base::scoped_nsobject<MediaGalleriesCocoaController> cocoa_controller( |
| 287 [[MediaGalleriesCocoaController alloc] init]); | 284 [[MediaGalleriesCocoaController alloc] init]); |
| 288 return new MediaGalleriesDialogCocoa(controller, cocoa_controller); | 285 return new MediaGalleriesDialogCocoa(controller, cocoa_controller); |
| 289 } | 286 } |
| OLD | NEW |