OLD | NEW |
---|---|
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 #ifndef CHROME_BROWSER_UI_COCOA_MEDIA_PICKER_DESKTOP_MEDIA_PICKER_BRIDGE_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_MEDIA_PICKER_DESKTOP_MEDIA_PICKER_BRIDGE_H_ |
6 #define CHROME_BROWSER_UI_COCOA_MEDIA_PICKER_DESKTOP_MEDIA_PICKER_BRIDGE_H_ | 6 #define CHROME_BROWSER_UI_COCOA_MEDIA_PICKER_DESKTOP_MEDIA_PICKER_BRIDGE_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "chrome/browser/media/desktop_media_list.h" | 9 #include "chrome/browser/media/desktop_media_list.h" |
10 #include "chrome/browser/media/desktop_media_list_observer.h" | 10 #include "chrome/browser/media/desktop_media_list_observer.h" |
11 | 11 |
12 // Protocol corresponding to |DesktopMediaListObserver|. | 12 // Protocol corresponding to |DesktopMediaListObserver|. |
13 @protocol DesktopMediaPickerObserver | 13 @protocol DesktopMediaPickerObserver |
14 - (void)sourceAddedAtIndex:(int)index; | 14 - (void)sourceAddedForList:(DesktopMediaList*)list AtIndex:(int)index; |
tapted
2016/06/20 12:18:34
AtIndex -> atIndex (or just index) - more below. A
qiangchen
2016/06/21 23:31:26
Done.
| |
15 - (void)sourceRemovedAtIndex:(int)index; | 15 - (void)sourceRemovedForList:(DesktopMediaList*)list AtIndex:(int)index; |
16 - (void)sourceMovedFrom:(int)oldIndex to:(int)newIndex; | 16 - (void)sourceMovedForList:(DesktopMediaList*)list |
17 - (void)sourceNameChangedAtIndex:(int)index; | 17 From:(int)oldIndex |
18 - (void)sourceThumbnailChangedAtIndex:(int)index; | 18 to:(int)newIndex; |
19 - (void)sourceNameChangedForList:(DesktopMediaList*)list AtIndex:(int)index; | |
20 - (void)sourceThumbnailChangedForList:(DesktopMediaList*)list | |
21 AtIndex:(int)index; | |
19 @end | 22 @end |
20 | 23 |
21 // Provides a |DesktopMediaListObserver| implementation that forwards | 24 // Provides a |DesktopMediaListObserver| implementation that forwards |
22 // notifications to a objective-c object implementing the | 25 // notifications to a objective-c object implementing the |
23 // |DesktopMediaPickerObserver| protocol. | 26 // |DesktopMediaPickerObserver| protocol. |
24 class DesktopMediaPickerBridge : public DesktopMediaListObserver { | 27 class DesktopMediaPickerBridge : public DesktopMediaListObserver { |
25 public: | 28 public: |
26 DesktopMediaPickerBridge(id<DesktopMediaPickerObserver> observer); | 29 DesktopMediaPickerBridge(id<DesktopMediaPickerObserver> observer); |
27 ~DesktopMediaPickerBridge() override; | 30 ~DesktopMediaPickerBridge() override; |
28 | 31 |
29 // DesktopMediaListObserver overrides. | 32 // DesktopMediaListObserver overrides. |
30 void OnSourceAdded(DesktopMediaList* list, int index) override; | 33 void OnSourceAdded(DesktopMediaList* list, int index) override; |
31 void OnSourceRemoved(DesktopMediaList* list, int index) override; | 34 void OnSourceRemoved(DesktopMediaList* list, int index) override; |
32 void OnSourceMoved(DesktopMediaList* list, | 35 void OnSourceMoved(DesktopMediaList* list, |
33 int old_index, | 36 int old_index, |
34 int new_index) override; | 37 int new_index) override; |
35 void OnSourceNameChanged(DesktopMediaList* list, int index) override; | 38 void OnSourceNameChanged(DesktopMediaList* list, int index) override; |
36 void OnSourceThumbnailChanged(DesktopMediaList* list, int index) override; | 39 void OnSourceThumbnailChanged(DesktopMediaList* list, int index) override; |
37 | 40 |
38 private: | 41 private: |
39 id<DesktopMediaPickerObserver> observer_; // weak; owns this | 42 id<DesktopMediaPickerObserver> observer_; // weak; owns this |
40 | 43 |
41 DISALLOW_COPY_AND_ASSIGN(DesktopMediaPickerBridge); | 44 DISALLOW_COPY_AND_ASSIGN(DesktopMediaPickerBridge); |
42 }; | 45 }; |
43 | 46 |
44 #endif // CHROME_BROWSER_UI_COCOA_MEDIA_PICKER_DESKTOP_MEDIA_PICKER_BRIDGE_H_ | 47 #endif // CHROME_BROWSER_UI_COCOA_MEDIA_PICKER_DESKTOP_MEDIA_PICKER_BRIDGE_H_ |
OLD | NEW |