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

Unified Diff: chrome/browser/ui/cocoa/media_picker/desktop_media_picker_controller.mm

Issue 89683003: Rename DesktopMediaPickerModel[Impl]->[Native]DesktopMediaList (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/media_picker/desktop_media_picker_controller.mm
diff --git a/chrome/browser/ui/cocoa/media_picker/desktop_media_picker_controller.mm b/chrome/browser/ui/cocoa/media_picker/desktop_media_picker_controller.mm
index 106c4e4f69d435229a58818892fdf610aa493512..31342a6ac73977b35cfb8f21262743ffbea1f247 100644
--- a/chrome/browser/ui/cocoa/media_picker/desktop_media_picker_controller.mm
+++ b/chrome/browser/ui/cocoa/media_picker/desktop_media_picker_controller.mm
@@ -54,9 +54,9 @@ const int kExcessButtonPadding = 6;
@implementation DesktopMediaPickerController
-- (id)initWithModel:(scoped_ptr<DesktopMediaPickerModel>)model
- callback:(const DesktopMediaPicker::DoneCallback&)callback
- appName:(const string16&)appName {
+- (id)initWithMediaList:(scoped_ptr<DesktopMediaList>)media_list
+ callback:(const DesktopMediaPicker::DoneCallback&)callback
+ appName:(const string16&)appName {
const NSUInteger kStyleMask =
NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask;
base::scoped_nsobject<NSWindow> window(
@@ -68,8 +68,8 @@ const int kExcessButtonPadding = 6;
if ((self = [super initWithWindow:window])) {
[window setDelegate:self];
[self initializeContentsWithAppName:appName];
- model_ = model.Pass();
- model_->SetViewDialogWindowId([window windowNumber]);
+ media_list_ = media_list.Pass();
+ media_list_->SetViewDialogWindowId([window windowNumber]);
doneCallback_ = callback;
items_.reset([[NSMutableArray alloc] init]);
bridge_.reset(new DesktopMediaPickerBridge(self));
@@ -159,10 +159,10 @@ const int kExcessButtonPadding = 6;
}
- (void)showWindow:(id)sender {
- // Signal the model to start sending thumbnails. |bridge_| is used as the
+ // Signal the media_list to start sending thumbnails. |bridge_| is used as the
// observer, and will forward notifications to this object.
- model_->SetThumbnailSize(gfx::Size(kThumbnailWidth, kThumbnailHeight));
- model_->StartUpdating(bridge_.get());
+ media_list_->SetThumbnailSize(gfx::Size(kThumbnailWidth, kThumbnailHeight));
+ media_list_->StartUpdating(bridge_.get());
[self.window center];
[super showWindow:sender];
@@ -257,7 +257,7 @@ const int kExcessButtonPadding = 6;
#pragma mark DesktopMediaPickerObserver
- (void)sourceAddedAtIndex:(int)index {
- const DesktopMediaPickerModel::Source& source = model_->source(index);
+ const DesktopMediaList::Source& source = media_list_->GetSource(index);
NSString* imageTitle = base::SysUTF16ToNSString(source.name);
base::scoped_nsobject<DesktopMediaPickerItem> item(
[[DesktopMediaPickerItem alloc] initWithSourceId:source.id
@@ -279,13 +279,13 @@ const int kExcessButtonPadding = 6;
- (void)sourceNameChangedAtIndex:(int)index {
DesktopMediaPickerItem* item = [items_ objectAtIndex:index];
- const DesktopMediaPickerModel::Source& source = model_->source(index);
+ const DesktopMediaList::Source& source = media_list_->GetSource(index);
[item setImageTitle:base::SysUTF16ToNSString(source.name)];
[sourceBrowser_ reloadData];
}
- (void)sourceThumbnailChangedAtIndex:(int)index {
- const DesktopMediaPickerModel::Source& source = model_->source(index);
+ const DesktopMediaList::Source& source = media_list_->GetSource(index);
NSImage* image = gfx::NSImageFromImageSkia(source.thumbnail);
DesktopMediaPickerItem* item = [items_ objectAtIndex:index];

Powered by Google App Engine
This is Rietveld 408576698