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
3 // found in the LICENSE file.
5 #import "chrome/browser/ui/cocoa/media_picker/desktop_media_picker_item.h"
7 #import <Quartz/Quartz.h>
9 #include "chrome/browser/media/desktop_media_list.h"
11 @implementation DesktopMediaPickerItem
13 - (id)initWithSourceId:(content::DesktopMediaID)sourceID
14 imageUID:(int)imageUID
15 imageTitle:(NSString*)imageTitle {
16 if ((self = [super init])) {
18 imageUID_.reset([[NSString stringWithFormat:@"%d", imageUID] retain]);
19 imageTitle_.reset([imageTitle retain]);
24 - (content::DesktopMediaID)sourceID {
28 - (void)setImageRepresentation:(NSImage*)image {
29 image_.reset([image retain]);
33 - (void)setImageTitle:(NSString*)imageTitle {
34 imageTitle_.reset([imageTitle copy]);
37 #pragma mark IKImageBrowserItem
39 - (NSString*)imageUID {
43 - (NSString*)imageRepresentationType {
44 return IKImageBrowserNSImageRepresentationType;
47 - (NSString*)imageTitle {
48 return imageTitle_.get();
51 - (NSUInteger)imageVersion {
55 - (id)imageRepresentation {
59 @end // @interface DesktopMediaPickerItem