[Metrics] Make MetricsStateManager take a callback param to check if UMA is enabled.
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / media_picker / desktop_media_picker_cocoa.mm
blob4466e2002d471c5999013f9fd11c92b49b34def0
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 #include "chrome/browser/ui/cocoa/media_picker/desktop_media_picker_cocoa.h"
7 #import "chrome/browser/ui/cocoa/media_picker/desktop_media_picker_controller.h"
9 DesktopMediaPickerCocoa::DesktopMediaPickerCocoa() {
12 DesktopMediaPickerCocoa::~DesktopMediaPickerCocoa() {
15 void DesktopMediaPickerCocoa::Show(gfx::NativeWindow context,
16                                    gfx::NativeWindow parent,
17                                    const base::string16& app_name,
18                                    const base::string16& target_name,
19                                    scoped_ptr<DesktopMediaList> media_list,
20                                    const DoneCallback& done_callback) {
21   controller_.reset(
22       [[DesktopMediaPickerController alloc] initWithMediaList:media_list.Pass()
23                                                        parent:parent
24                                                      callback:done_callback
25                                                       appName:app_name
26                                                    targetName:target_name]);
27   [controller_ showWindow:nil];
30 // static
31 scoped_ptr<DesktopMediaPicker> DesktopMediaPicker::Create() {
32   return scoped_ptr<DesktopMediaPicker>(new DesktopMediaPickerCocoa());