remote_command_center_delegate_cocoa.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // Copyright 2019 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. #ifndef COMPONENTS_SYSTEM_MEDIA_CONTROLS_MAC_REMOTE_COMMAND_CENTER_DELEGATE_COCOA_H_
  5. #define COMPONENTS_SYSTEM_MEDIA_CONTROLS_MAC_REMOTE_COMMAND_CENTER_DELEGATE_COCOA_H_
  6. #include "base/memory/raw_ptr.h"
  7. #import <Cocoa/Cocoa.h>
  8. #import <MediaPlayer/MediaPlayer.h>
  9. namespace system_media_controls {
  10. namespace internal {
  11. class RemoteCommandCenterDelegate;
  12. } // namespace internal
  13. } // namespace system_media_controls
  14. @interface RemoteCommandCenterDelegateCocoa : NSObject {
  15. @private
  16. raw_ptr<system_media_controls::internal::RemoteCommandCenterDelegate>
  17. _delegate;
  18. }
  19. - (instancetype)initWithDelegate:
  20. (system_media_controls::internal::RemoteCommandCenterDelegate*)delegate;
  21. // Called by the OS via the MPRemoteCommandCenter.
  22. - (MPRemoteCommandHandlerStatus)onCommand:(MPRemoteCommandEvent*)event;
  23. // Called by the RemoteCommandCenterDelegate to enable/disable different
  24. // commands.
  25. - (void)setCanPlay:(bool)can_play;
  26. - (void)setCanPause:(bool)can_pause;
  27. - (void)setCanStop:(bool)can_stop;
  28. - (void)setCanPlayPause:(bool)can_playpause;
  29. - (void)setCanGoNextTrack:(bool)can_go_next_track;
  30. - (void)setCanGoPreviousTrack:(bool)can_go_prev_track;
  31. - (void)setCanSeekTo:(bool)can_seek_to;
  32. @end
  33. #endif // COMPONENTS_SYSTEM_MEDIA_CONTROLS_MAC_REMOTE_COMMAND_CENTER_DELEGATE_COCOA_H_