Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Side by Side Diff: chrome/browser/ui/cocoa/media_picker/desktop_media_picker_controller.mm

Issue 1128353005: Disallow multiple selection in desktop media picker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #import "base/mac/bundle_locations.h" 9 #import "base/mac/bundle_locations.h"
10 #include "base/strings/sys_string_conversions.h" 10 #include "base/strings/sys_string_conversions.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 [content addSubview:description]; 120 [content addSubview:description];
121 origin.y += NSHeight([description frame]) + kControlSpacing; 121 origin.y += NSHeight([description frame]) + kControlSpacing;
122 122
123 // Create the image browser. 123 // Create the image browser.
124 sourceBrowser_.reset([[IKImageBrowserView alloc] initWithFrame:NSZeroRect]); 124 sourceBrowser_.reset([[IKImageBrowserView alloc] initWithFrame:NSZeroRect]);
125 NSUInteger cellStyle = IKCellsStyleShadowed | IKCellsStyleTitled; 125 NSUInteger cellStyle = IKCellsStyleShadowed | IKCellsStyleTitled;
126 [sourceBrowser_ setDelegate:self]; 126 [sourceBrowser_ setDelegate:self];
127 [sourceBrowser_ setDataSource:self]; 127 [sourceBrowser_ setDataSource:self];
128 [sourceBrowser_ setCellsStyleMask:cellStyle]; 128 [sourceBrowser_ setCellsStyleMask:cellStyle];
129 [sourceBrowser_ setCellSize:NSMakeSize(kThumbnailWidth, kThumbnailHeight)]; 129 [sourceBrowser_ setCellSize:NSMakeSize(kThumbnailWidth, kThumbnailHeight)];
130 [sourceBrowser_ setAllowsMultipleSelection:NO];
130 131
131 // Create a scroll view to host the image browser. 132 // Create a scroll view to host the image browser.
132 NSRect imageBrowserScrollFrame = NSMakeRect( 133 NSRect imageBrowserScrollFrame = NSMakeRect(
133 origin.x, origin.y, kPaddedWidth, 350); 134 origin.x, origin.y, kPaddedWidth, 350);
134 base::scoped_nsobject<NSScrollView> imageBrowserScroll( 135 base::scoped_nsobject<NSScrollView> imageBrowserScroll(
135 [[NSScrollView alloc] initWithFrame:imageBrowserScrollFrame]); 136 [[NSScrollView alloc] initWithFrame:imageBrowserScrollFrame]);
136 [imageBrowserScroll setHasVerticalScroller:YES]; 137 [imageBrowserScroll setHasVerticalScroller:YES];
137 [imageBrowserScroll setDocumentView:sourceBrowser_]; 138 [imageBrowserScroll setDocumentView:sourceBrowser_];
138 [imageBrowserScroll setBorderType:NSBezelBorder]; 139 [imageBrowserScroll setBorderType:NSBezelBorder];
139 [imageBrowserScroll setAutoresizingMask: 140 [imageBrowserScroll setAutoresizingMask:
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 - (void)sourceThumbnailChangedAtIndex:(int)index { 325 - (void)sourceThumbnailChangedAtIndex:(int)index {
325 const DesktopMediaList::Source& source = media_list_->GetSource(index); 326 const DesktopMediaList::Source& source = media_list_->GetSource(index);
326 NSImage* image = gfx::NSImageFromImageSkia(source.thumbnail); 327 NSImage* image = gfx::NSImageFromImageSkia(source.thumbnail);
327 328
328 DesktopMediaPickerItem* item = [items_ objectAtIndex:index]; 329 DesktopMediaPickerItem* item = [items_ objectAtIndex:index];
329 [item setImageRepresentation:image]; 330 [item setImageRepresentation:image];
330 [sourceBrowser_ reloadData]; 331 [sourceBrowser_ reloadData];
331 } 332 }
332 333
333 @end // @interface DesktopMediaPickerController 334 @end // @interface DesktopMediaPickerController
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698