summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/ash/media_delegate_chromeos.h
blob: a3e525e588ea66e79af757aa0c82fa8338bdd852 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_UI_ASH_MEDIA_DELEGATE_CHROMEOS_H_
#define CHROME_BROWSER_UI_ASH_MEDIA_DELEGATE_CHROMEOS_H_

#include "ash/media_delegate.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "chrome/browser/media/media_capture_devices_dispatcher.h"

class MediaDelegateChromeOS : public ash::MediaDelegate,
                              MediaCaptureDevicesDispatcher::Observer {
 public:
  MediaDelegateChromeOS();
  ~MediaDelegateChromeOS() override;

  // ash::MediaDelegate:
  void HandleMediaNextTrack() override;
  void HandleMediaPlayPause() override;
  void HandleMediaPrevTrack() override;
  ash::MediaCaptureState GetMediaCaptureState(ash::UserIndex index) override;

  // MediaCaptureDevicesDispatcher::Observer:
  void OnRequestUpdate(int render_process_id,
                       int render_frame_id,
                       content::MediaStreamType stream_type,
                       const content::MediaRequestState state) override;

 private:
  void NotifyMediaCaptureChange();

  base::WeakPtrFactory<MediaDelegateChromeOS> weak_ptr_factory_;

  DISALLOW_COPY_AND_ASSIGN(MediaDelegateChromeOS);
};

#endif  // CHROME_BROWSER_UI_ASH_MEDIA_DELEGATE_CHROMEOS_H_