| OLD | NEW |
| (Empty) |
| 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. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_UI_COCOA_MEDIA_PICKER_DESKTOP_MEDIA_PICKER_CONTROLLER_DEP
RECATED_H_ | |
| 6 #define CHROME_BROWSER_UI_COCOA_MEDIA_PICKER_DESKTOP_MEDIA_PICKER_CONTROLLER_DEP
RECATED_H_ | |
| 7 | |
| 8 #import <Cocoa/Cocoa.h> | |
| 9 #import <Quartz/Quartz.h> | |
| 10 | |
| 11 #include <memory> | |
| 12 | |
| 13 #include "base/callback.h" | |
| 14 #import "base/mac/scoped_nsobject.h" | |
| 15 #include "base/strings/string16.h" | |
| 16 #include "chrome/browser/media/webrtc/desktop_media_list.h" | |
| 17 #include "chrome/browser/media/webrtc/desktop_media_picker.h" | |
| 18 #import "chrome/browser/ui/cocoa/media_picker/desktop_media_picker_bridge.h" | |
| 19 | |
| 20 // A controller for the Desktop Media Picker. Presents the user with a list of | |
| 21 // media sources for screen-capturing, and reports the result. | |
| 22 @interface DesktopMediaPickerControllerDeprecated | |
| 23 : NSWindowController<NSWindowDelegate, DesktopMediaPickerObserver> { | |
| 24 @private | |
| 25 // The image browser view to present sources to the user (thumbnails and | |
| 26 // names). | |
| 27 base::scoped_nsobject<IKImageBrowserView> sourceBrowser_; | |
| 28 | |
| 29 // The button used to confirm the selection. | |
| 30 NSButton* shareButton_; // weak; owned by contentView | |
| 31 | |
| 32 // The button used to cancel and close the dialog. | |
| 33 NSButton* cancelButton_; // weak; owned by contentView | |
| 34 | |
| 35 // The checkbox for audio share. | |
| 36 // |audioShareState_| records the state when check box is disabled. | |
| 37 base::scoped_nsobject<NSButton> audioShareCheckbox_; | |
| 38 NSCellStateValue audioShareState_; | |
| 39 | |
| 40 // Provides source information (including thumbnails) to fill up |items_| and | |
| 41 // to render in |sourceBrowser_|. | |
| 42 std::unique_ptr<DesktopMediaList> media_list_; | |
| 43 | |
| 44 // To be called with the user selection. | |
| 45 DesktopMediaPicker::DoneCallback doneCallback_; | |
| 46 | |
| 47 // Array of |DesktopMediaPickerItem| used as data for |sourceBrowser_|. | |
| 48 base::scoped_nsobject<NSMutableArray> items_; | |
| 49 | |
| 50 // C++ bridge to use as an observer to |media_list_|, that forwards obj-c | |
| 51 // notifications to this object. | |
| 52 std::unique_ptr<DesktopMediaPickerBridge> bridge_; | |
| 53 | |
| 54 // Used to create |DesktopMediaPickerItem|s with unique IDs. | |
| 55 int lastImageUID_; | |
| 56 } | |
| 57 | |
| 58 // Designated initializer. | |
| 59 // To show the dialog, use |NSWindowController|'s |showWindow:|. | |
| 60 // |callback| will be called to report the user's selection. | |
| 61 // |appName| will be used to format the dialog's title and the label, where it | |
| 62 // appears as the initiator of the request. | |
| 63 // |targetName| will be used to format the dialog's label and appear as the | |
| 64 // consumer of the requested stream. | |
| 65 - (id)initWithScreenList:(std::unique_ptr<DesktopMediaList>)screen_list | |
| 66 windowList:(std::unique_ptr<DesktopMediaList>)window_list | |
| 67 tabList:(std::unique_ptr<DesktopMediaList>)tab_list | |
| 68 parent:(NSWindow*)parent | |
| 69 callback:(const DesktopMediaPicker::DoneCallback&)callback | |
| 70 appName:(const base::string16&)appName | |
| 71 targetName:(const base::string16&)targetName | |
| 72 requestAudio:(bool)requestAudio; | |
| 73 | |
| 74 @end | |
| 75 | |
| 76 #endif // CHROME_BROWSER_UI_COCOA_MEDIA_PICKER_DESKTOP_MEDIA_PICKER_CONTROLLER_
DEPRECATED_H_ | |
| OLD | NEW |