| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/media_picker/desktop_media_picker_controller.h" | 5 #import "chrome/browser/ui/cocoa/media_picker/desktop_media_picker_controller.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 requestAudio:(bool)requestAudio { | 123 requestAudio:(bool)requestAudio { |
| 124 // Use flipped coordinates to facilitate manual layout. | 124 // Use flipped coordinates to facilitate manual layout. |
| 125 const CGFloat kPaddedWidth = kInitialContentWidth - (kFramePadding * 2); | 125 const CGFloat kPaddedWidth = kInitialContentWidth - (kFramePadding * 2); |
| 126 base::scoped_nsobject<FlippedView> content( | 126 base::scoped_nsobject<FlippedView> content( |
| 127 [[FlippedView alloc] initWithFrame:NSZeroRect]); | 127 [[FlippedView alloc] initWithFrame:NSZeroRect]); |
| 128 [[self window] setContentView:content]; | 128 [[self window] setContentView:content]; |
| 129 NSPoint origin = NSMakePoint(kFramePadding, kFramePadding); | 129 NSPoint origin = NSMakePoint(kFramePadding, kFramePadding); |
| 130 | 130 |
| 131 // Set the dialog's title. | 131 // Set the dialog's title. |
| 132 NSString* titleText = l10n_util::GetNSStringF( | 132 NSString* titleText = l10n_util::GetNSStringF( |
| 133 IDS_DESKTOP_MEDIA_PICKER_TITLE, appName); | 133 IDS_DESKTOP_MEDIA_PICKER_TITLE_DEPRECATED, appName); |
| 134 [[self window] setTitle:titleText]; | 134 [[self window] setTitle:titleText]; |
| 135 | 135 |
| 136 // Set the dialog's description. | 136 // Set the dialog's description. |
| 137 NSString* descriptionText; | 137 NSString* descriptionText; |
| 138 if (appName == targetName) { | 138 if (appName == targetName) { |
| 139 descriptionText = l10n_util::GetNSStringF( | 139 descriptionText = l10n_util::GetNSStringF( |
| 140 IDS_DESKTOP_MEDIA_PICKER_TEXT, appName); | 140 IDS_DESKTOP_MEDIA_PICKER_TEXT, appName); |
| 141 } else { | 141 } else { |
| 142 descriptionText = l10n_util::GetNSStringF( | 142 descriptionText = l10n_util::GetNSStringF( |
| 143 IDS_DESKTOP_MEDIA_PICKER_TEXT_DELEGATED, appName, targetName); | 143 IDS_DESKTOP_MEDIA_PICKER_TEXT_DELEGATED, appName, targetName); |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 - (void)sourceThumbnailChangedAtIndex:(int)index { | 433 - (void)sourceThumbnailChangedAtIndex:(int)index { |
| 434 const DesktopMediaList::Source& source = media_list_->GetSource(index); | 434 const DesktopMediaList::Source& source = media_list_->GetSource(index); |
| 435 NSImage* image = gfx::NSImageFromImageSkia(source.thumbnail); | 435 NSImage* image = gfx::NSImageFromImageSkia(source.thumbnail); |
| 436 | 436 |
| 437 DesktopMediaPickerItem* item = [items_ objectAtIndex:index]; | 437 DesktopMediaPickerItem* item = [items_ objectAtIndex:index]; |
| 438 [item setImageRepresentation:image]; | 438 [item setImageRepresentation:image]; |
| 439 [sourceBrowser_ reloadData]; | 439 [sourceBrowser_ reloadData]; |
| 440 } | 440 } |
| 441 | 441 |
| 442 @end // @interface DesktopMediaPickerController | 442 @end // @interface DesktopMediaPickerController |
| OLD | NEW |