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

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

Issue 336833002: Close the media picker window when DesktopMediaPickerController is destructed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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 #import "base/mac/bundle_locations.h" 8 #import "base/mac/bundle_locations.h"
9 #include "base/strings/sys_string_conversions.h" 9 #include "base/strings/sys_string_conversions.h"
10 #import "chrome/browser/ui/cocoa/media_picker/desktop_media_picker_item.h" 10 #import "chrome/browser/ui/cocoa/media_picker/desktop_media_picker_item.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 bridge_.reset(new DesktopMediaPickerBridge(self)); 78 bridge_.reset(new DesktopMediaPickerBridge(self));
79 } 79 }
80 return self; 80 return self;
81 } 81 }
82 82
83 - (void)dealloc { 83 - (void)dealloc {
84 [shareButton_ setTarget:nil]; 84 [shareButton_ setTarget:nil];
85 [cancelButton_ setTarget:nil]; 85 [cancelButton_ setTarget:nil];
86 [sourceBrowser_ setDelegate:nil]; 86 [sourceBrowser_ setDelegate:nil];
87 [sourceBrowser_ setDataSource:nil]; 87 [sourceBrowser_ setDataSource:nil];
88 [[self window] close];
88 [super dealloc]; 89 [super dealloc];
89 } 90 }
90 91
91 - (void)initializeContentsWithAppName:(const base::string16&)appName 92 - (void)initializeContentsWithAppName:(const base::string16&)appName
92 targetName:(const base::string16&)targetName { 93 targetName:(const base::string16&)targetName {
93 // Use flipped coordinates to facilitate manual layout. 94 // Use flipped coordinates to facilitate manual layout.
94 const CGFloat kPaddedWidth = kInitialContentWidth - (kFramePadding * 2); 95 const CGFloat kPaddedWidth = kInitialContentWidth - (kFramePadding * 2);
95 base::scoped_nsobject<FlippedView> content( 96 base::scoped_nsobject<FlippedView> content(
96 [[FlippedView alloc] initWithFrame:NSZeroRect]); 97 [[FlippedView alloc] initWithFrame:NSZeroRect]);
97 [[self window] setContentView:content]; 98 [[self window] setContentView:content];
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 - (void)sourceThumbnailChangedAtIndex:(int)index { 313 - (void)sourceThumbnailChangedAtIndex:(int)index {
313 const DesktopMediaList::Source& source = media_list_->GetSource(index); 314 const DesktopMediaList::Source& source = media_list_->GetSource(index);
314 NSImage* image = gfx::NSImageFromImageSkia(source.thumbnail); 315 NSImage* image = gfx::NSImageFromImageSkia(source.thumbnail);
315 316
316 DesktopMediaPickerItem* item = [items_ objectAtIndex:index]; 317 DesktopMediaPickerItem* item = [items_ objectAtIndex:index];
317 [item setImageRepresentation:image]; 318 [item setImageRepresentation:image];
318 [sourceBrowser_ reloadData]; 319 [sourceBrowser_ reloadData];
319 } 320 }
320 321
321 @end // @interface DesktopMediaPickerController 322 @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