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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 - (void)reportResult:(content::DesktopMediaID)sourceID; | 56 - (void)reportResult:(content::DesktopMediaID)sourceID; |
57 | 57 |
58 // Action handlers. | 58 // Action handlers. |
59 - (void)sharePressed:(id)sender; | 59 - (void)sharePressed:(id)sender; |
60 - (void)cancelPressed:(id)sender; | 60 - (void)cancelPressed:(id)sender; |
61 | 61 |
62 @end | 62 @end |
63 | 63 |
64 @implementation DesktopMediaPickerController | 64 @implementation DesktopMediaPickerController |
65 | 65 |
66 - (id)initWithMediaList:(scoped_ptr<DesktopMediaList>)media_list | 66 - (id)initWithMediaList:(std::unique_ptr<DesktopMediaList>)media_list |
67 parent:(NSWindow*)parent | 67 parent:(NSWindow*)parent |
68 callback:(const DesktopMediaPicker::DoneCallback&)callback | 68 callback:(const DesktopMediaPicker::DoneCallback&)callback |
69 appName:(const base::string16&)appName | 69 appName:(const base::string16&)appName |
70 targetName:(const base::string16&)targetName | 70 targetName:(const base::string16&)targetName |
71 requestAudio:(bool)requestAudio { | 71 requestAudio:(bool)requestAudio { |
72 const NSUInteger kStyleMask = | 72 const NSUInteger kStyleMask = |
73 NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask; | 73 NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask; |
74 base::scoped_nsobject<NSWindow> window( | 74 base::scoped_nsobject<NSWindow> window( |
75 [[NSWindow alloc] initWithContentRect:ui::kWindowSizeDeterminedLater | 75 [[NSWindow alloc] initWithContentRect:ui::kWindowSizeDeterminedLater |
76 styleMask:kStyleMask | 76 styleMask:kStyleMask |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 - (void)sourceThumbnailChangedAtIndex:(int)index { | 405 - (void)sourceThumbnailChangedAtIndex:(int)index { |
406 const DesktopMediaList::Source& source = media_list_->GetSource(index); | 406 const DesktopMediaList::Source& source = media_list_->GetSource(index); |
407 NSImage* image = gfx::NSImageFromImageSkia(source.thumbnail); | 407 NSImage* image = gfx::NSImageFromImageSkia(source.thumbnail); |
408 | 408 |
409 DesktopMediaPickerItem* item = [items_ objectAtIndex:index]; | 409 DesktopMediaPickerItem* item = [items_ objectAtIndex:index]; |
410 [item setImageRepresentation:image]; | 410 [item setImageRepresentation:image]; |
411 [sourceBrowser_ reloadData]; | 411 [sourceBrowser_ reloadData]; |
412 } | 412 } |
413 | 413 |
414 @end // @interface DesktopMediaPickerController | 414 @end // @interface DesktopMediaPickerController |
OLD | NEW |