Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Side by Side Diff: content/renderer/pepper/pepper_audio_controller.h

Issue 2065513004: Expose flash playback status and volume control to content renderer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@audio_focus_manager
Patch Set: addressed bbudge's comments Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 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 CONTENT_RENDERER_PEPPER_PEPPER_AUDIO_CONTROLLER_H_
6 #define CONTENT_RENDERER_PEPPER_PEPPER_AUDIO_CONTROLLER_H_
7
8 #include <set>
9
10 #include "base/macros.h"
11
12 namespace content {
13
14 class PepperPluginInstanceImpl;
15 class PPB_Audio_Impl;
16
17 /**
18 * Class for controlling all the active audio instances of a Pepper instance.
19 * This class can only be a non-shareable member of PepperPluginInstanceImpl.
20 */
mlamouri (slow - plz ping) 2016/06/23 13:04:13 style: we don't use /** comments. I think it shoul
Zhiqiang Zhang (Slow) 2016/06/23 14:50:29 Done.
21 class PepperAudioController {
22 public:
23 // Contructor of PepperAudioController.
24 PepperAudioController(PepperPluginInstanceImpl* pepper_instance);
mlamouri (slow - plz ping) 2016/06/23 13:04:13 add explicit. Also, I don't think the comment is
Zhiqiang Zhang (Slow) 2016/06/23 14:50:29 Done.
25 // Destructor of PepperAudioController.
mlamouri (slow - plz ping) 2016/06/23 13:04:13 ditto for the comment :)
Zhiqiang Zhang (Slow) 2016/06/23 14:50:29 Done.
26 virtual ~PepperAudioController();
27
28 // Adds an audio instance to the controller.
29 void AddInstance(PPB_Audio_Impl* audio);
30 // Removes an audio instance from the controller.
31 void RemoveInstance(PPB_Audio_Impl* audio);
32 // Sets the volume of all delegated audio resources.
33 void SetVolume(double volume);
34 // The pepper instance has been deleted. This method can only be called
35 // once. The controller will be invalidated after this call, and then all
36 // other methods will be no-op.
37 void OnPepperInstanceDeleted();
38
39 private:
40 // Notifies the RenderFrame that the playback has stopped. This method should
41 // only be called when |ppb_audios_| turns from non-empty to empty.
42 void NotifyPlaybackStopsOnEmpty();
43
44 // All active audio instances.
45 std::set<PPB_Audio_Impl*> ppb_audios_;
46 // The Pepper instance which this controller is for. Will be null after
47 // OnPepperInstanceDeleted() is called.
48 PepperPluginInstanceImpl* instance_;
mlamouri (slow - plz ping) 2016/06/23 13:04:13 style: leave an empty line between two methods or
Zhiqiang Zhang (Slow) 2016/06/23 14:50:29 Done (and for all the methods above as well).
49
50 DISALLOW_COPY_AND_ASSIGN(PepperAudioController);
51 };
52
53 } // namespace content
54
55 #endif // CONTENT_RENDERER_PEPPER_PEPPER_AUDIO_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698