| Index: content/browser/media/android/audio_focus_manager.h
|
| diff --git a/content/browser/media/android/audio_focus_manager.h b/content/browser/media/android/audio_focus_manager.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..1d72833b79422f62fafd0f799a535a4509626fcb
|
| --- /dev/null
|
| +++ b/content/browser/media/android/audio_focus_manager.h
|
| @@ -0,0 +1,49 @@
|
| +// Copyright 2015 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 CONTENT_BROWSER_MEDIA_ANDROID_AUDIO_FOCUS_MANAGER_H_
|
| +#define CONTENT_BROWSER_MEDIA_ANDROID_AUDIO_FOCUS_MANAGER_H_
|
| +
|
| +#include <jni.h>
|
| +
|
| +#include "base/android/scoped_java_ref.h"
|
| +#include "base/memory/ref_counted.h"
|
| +#include "base/memory/weak_ptr.h"
|
| +
|
| +namespace base {
|
| +class SingleThreadTaskRunner;
|
| +}
|
| +
|
| +namespace content {
|
| +class BrowserMediaPlayerManager;
|
| +
|
| +class AudioFocusManager {
|
| + public:
|
| + AudioFocusManager(
|
| + const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
|
| + base::WeakPtr<BrowserMediaPlayerManager> manager);
|
| + ~AudioFocusManager();
|
| +
|
| + static bool RegisterAudioFocusManager(JNIEnv* env);
|
| +
|
| + // Called by AudioFocusManager.java.
|
| + void OnMediaInterrupted(JNIEnv*, jobject, jint player_id);
|
| +
|
| + // Called by browser_media_player_manager.cc
|
| + void RequestAudioFocus(int player_id);
|
| + void AbandonAudioFocus(int player_id);
|
| +
|
| + private:
|
| + scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
|
| +
|
| + base::WeakPtr<BrowserMediaPlayerManager> manager_;
|
| +
|
| + base::android::ScopedJavaGlobalRef<jobject> j_audio_focus_manager_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(AudioFocusManager);
|
| +};
|
| +
|
| +} // namespace content
|
| +
|
| +#endif // CONTENT_BROWSER_MEDIA_ANDROID_AUDIO_FOCUS_MANAGER_H_
|
|
|