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

Unified Diff: media/base/android/media_player_bridge.cc

Issue 1215713021: Reverted the code for the non-interactive audible tab notification (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@notification
Patch Set: Fixed indent Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/android/media_player_android.cc ('k') | media/base/android/media_player_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/android/media_player_bridge.cc
diff --git a/media/base/android/media_player_bridge.cc b/media/base/android/media_player_bridge.cc
index 573056e6d696435200635ba8ca2edafc3c87e235..4cae2a7a5a52faf705f3c61b2ea41ec862c73ea8 100644
--- a/media/base/android/media_player_bridge.cc
+++ b/media/base/android/media_player_bridge.cc
@@ -354,8 +354,6 @@ void MediaPlayerBridge::Release() {
if (j_media_player_bridge_.is_null())
return;
- SetAudible(false);
-
time_update_timer_.Stop();
if (prepared_) {
pending_seek_ = GetCurrentTime();
@@ -372,22 +370,16 @@ void MediaPlayerBridge::Release() {
}
void MediaPlayerBridge::SetVolume(double volume) {
- volume_ = volume;
-
- if (j_media_player_bridge_.is_null())
+ if (j_media_player_bridge_.is_null()) {
+ volume_ = volume;
return;
+ }
JNIEnv* env = base::android::AttachCurrentThread();
CHECK(env);
- // Update the audible state if we are playing.
- jboolean is_playing = Java_MediaPlayerBridge_isPlaying(
- env, j_media_player_bridge_.obj());
- if (is_playing)
- SetAudible(volume_ > 0);
-
Java_MediaPlayerBridge_setVolume(
- env, j_media_player_bridge_.obj(), volume_);
+ env, j_media_player_bridge_.obj(), volume);
}
void MediaPlayerBridge::OnVideoSizeChanged(int width, int height) {
@@ -397,13 +389,11 @@ void MediaPlayerBridge::OnVideoSizeChanged(int width, int height) {
}
void MediaPlayerBridge::OnPlaybackComplete() {
- SetAudible(false);
time_update_timer_.Stop();
MediaPlayerAndroid::OnPlaybackComplete();
}
void MediaPlayerBridge::OnMediaInterrupted() {
- SetAudible(false);
time_update_timer_.Stop();
MediaPlayerAndroid::OnMediaInterrupted();
}
@@ -468,13 +458,9 @@ void MediaPlayerBridge::StartInternal() {
base::TimeDelta::FromMilliseconds(kTimeUpdateInterval),
this, &MediaPlayerBridge::OnTimeUpdateTimerFired);
}
-
- SetAudible(volume_ > 0);
}
void MediaPlayerBridge::PauseInternal() {
- SetAudible(false);
-
JNIEnv* env = base::android::AttachCurrentThread();
Java_MediaPlayerBridge_pause(env, j_media_player_bridge_.obj());
time_update_timer_.Stop();
« no previous file with comments | « media/base/android/media_player_android.cc ('k') | media/base/android/media_player_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698