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/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "chrome/browser/media/desktop_media_list_observer.h" | 9 #include "chrome/browser/media/desktop_media_list_observer.h" |
10 | 10 |
11 // Protocol corresponding to |DesktopMediaListObserver|. | 11 // Protocol corresponding to |DesktopMediaListObserver|. |
12 @protocol DesktopMediaPickerObserver | 12 @protocol DesktopMediaPickerObserver |
13 - (void)sourceAddedAtIndex:(int)index; | 13 - (void)sourceAddedAtIndex:(int)index; |
14 - (void)sourceRemovedAtIndex:(int)index; | 14 - (void)sourceRemovedAtIndex:(int)index; |
15 - (void)sourceMovedFrom:(int)oldIndex to:(int)newIndex; | 15 - (void)sourceMovedFrom:(int)oldIndex to:(int)newIndex; |
16 - (void)sourceNameChangedAtIndex:(int)index; | 16 - (void)sourceNameChangedAtIndex:(int)index; |
17 - (void)sourceThumbnailChangedAtIndex:(int)index; | 17 - (void)sourceThumbnailChangedAtIndex:(int)index; |
18 @end | 18 @end |
19 | 19 |
20 // Provides a |DesktopMediaListObserver| implementation that forwards | 20 // Provides a |DesktopMediaListObserver| implementation that forwards |
21 // notifications to a objective-c object implementing the | 21 // notifications to a objective-c object implementing the |
22 // |DesktopMediaPickerObserver| protocol. | 22 // |DesktopMediaPickerObserver| protocol. |
23 class DesktopMediaPickerBridge : public DesktopMediaListObserver { | 23 class DesktopMediaPickerBridge : public DesktopMediaListObserver { |
24 public: | 24 public: |
25 DesktopMediaPickerBridge(id<DesktopMediaPickerObserver> observer); | 25 DesktopMediaPickerBridge(id<DesktopMediaPickerObserver> observer); |
26 virtual ~DesktopMediaPickerBridge(); | 26 virtual ~DesktopMediaPickerBridge(); |
27 | 27 |
28 // DesktopMediaListObserver overrides. | 28 // DesktopMediaListObserver overrides. |
29 virtual void OnSourceAdded(int index) OVERRIDE; | 29 virtual void OnSourceAdded(int index) override; |
30 virtual void OnSourceRemoved(int index) OVERRIDE; | 30 virtual void OnSourceRemoved(int index) override; |
31 virtual void OnSourceMoved(int old_index, int new_index) OVERRIDE; | 31 virtual void OnSourceMoved(int old_index, int new_index) override; |
32 virtual void OnSourceNameChanged(int index) OVERRIDE; | 32 virtual void OnSourceNameChanged(int index) override; |
33 virtual void OnSourceThumbnailChanged(int index) OVERRIDE; | 33 virtual void OnSourceThumbnailChanged(int index) override; |
34 | 34 |
35 private: | 35 private: |
36 id<DesktopMediaPickerObserver> observer_; // weak; owns this | 36 id<DesktopMediaPickerObserver> observer_; // weak; owns this |
37 | 37 |
38 DISALLOW_COPY_AND_ASSIGN(DesktopMediaPickerBridge); | 38 DISALLOW_COPY_AND_ASSIGN(DesktopMediaPickerBridge); |
39 }; | 39 }; |
40 | 40 |
41 #endif // CHROME_BROWSER_UI_COCOA_MEDIA_PICKER_DESKTOP_MEDIA_PICKER_BRIDGE_H_ | 41 #endif // CHROME_BROWSER_UI_COCOA_MEDIA_PICKER_DESKTOP_MEDIA_PICKER_BRIDGE_H_ |
OLD | NEW |