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

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 1159113006: [Android] A prototype of the interactive media notification. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added some null checks and hiding the notification when the tab is destroyed. Created 5 years, 5 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 #include "ui/gl/gl_switches.h" 108 #include "ui/gl/gl_switches.h"
109 109
110 #if defined(ENABLE_BROWSER_CDMS) 110 #if defined(ENABLE_BROWSER_CDMS)
111 #include "content/browser/media/media_web_contents_observer.h" 111 #include "content/browser/media/media_web_contents_observer.h"
112 #endif 112 #endif
113 113
114 #if defined(OS_ANDROID) 114 #if defined(OS_ANDROID)
115 #include "content/browser/android/content_video_view.h" 115 #include "content/browser/android/content_video_view.h"
116 #include "content/browser/android/date_time_chooser_android.h" 116 #include "content/browser/android/date_time_chooser_android.h"
117 #include "content/browser/android/media_players_observer.h" 117 #include "content/browser/android/media_players_observer.h"
118 #include "content/browser/media/android/media_session.h"
118 #include "content/browser/web_contents/web_contents_android.h" 119 #include "content/browser/web_contents/web_contents_android.h"
119 #endif 120 #endif
120 121
121 #if defined(OS_MACOSX) 122 #if defined(OS_MACOSX)
122 #include "base/mac/foundation_util.h" 123 #include "base/mac/foundation_util.h"
123 #endif 124 #endif
124 125
125 namespace content { 126 namespace content {
126 namespace { 127 namespace {
127 128
(...skipping 3130 matching lines...) Expand 10 before | Expand all | Expand 10 after
3258 } 3259 }
3259 3260
3260 void WebContentsImpl::OnMediaPausedNotification(int64 player_cookie) { 3261 void WebContentsImpl::OnMediaPausedNotification(int64 player_cookie) {
3261 RemoveMediaPlayerEntry(player_cookie, &active_audio_players_); 3262 RemoveMediaPlayerEntry(player_cookie, &active_audio_players_);
3262 RemoveMediaPlayerEntry(player_cookie, &active_video_players_); 3263 RemoveMediaPlayerEntry(player_cookie, &active_video_players_);
3263 MaybeReleasePowerSaveBlockers(); 3264 MaybeReleasePowerSaveBlockers();
3264 3265
3265 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaPaused()); 3266 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaPaused());
3266 } 3267 }
3267 3268
3269 void WebContentsImpl::OnMediaSessionStateChanged() {
3270 #if defined(OS_ANDROID)
3271 MediaSession* session = MediaSession::Get(this);
3272 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
3273 MediaSessionStateChanged(session->IsControllable(),
3274 session->IsSuspended()));
3275 #else
3276 NOTIMPLEMENTED();
3277 #endif
3278 }
3279
3280 void WebContentsImpl::ResumeMediaSession() {
3281 #if defined(OS_ANDROID)
3282 MediaSession::Get(this)->Resume();
3283 #else
3284 NOTIMPLEMENTED();
3285 #endif
3286 }
3287
3288 void WebContentsImpl::SuspendMediaSession() {
3289 #if defined(OS_ANDROID)
3290 MediaSession::Get(this)->Suspend();
3291 #else
3292 NOTIMPLEMENTED();
3293 #endif
3294 }
3295
3268 void WebContentsImpl::OnFirstVisuallyNonEmptyPaint() { 3296 void WebContentsImpl::OnFirstVisuallyNonEmptyPaint() {
3269 FOR_EACH_OBSERVER(WebContentsObserver, observers_, 3297 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
3270 DidFirstVisuallyNonEmptyPaint()); 3298 DidFirstVisuallyNonEmptyPaint());
3271 3299
3272 did_first_visually_non_empty_paint_ = true; 3300 did_first_visually_non_empty_paint_ = true;
3273 3301
3274 if (theme_color_ != last_sent_theme_color_) { 3302 if (theme_color_ != last_sent_theme_color_) {
3275 // Theme color should have updated by now if there was one. 3303 // Theme color should have updated by now if there was one.
3276 FOR_EACH_OBSERVER(WebContentsObserver, observers_, 3304 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
3277 DidChangeThemeColor(theme_color_)); 3305 DidChangeThemeColor(theme_color_));
(...skipping 1206 matching lines...) Expand 10 before | Expand all | Expand 10 after
4484 player_map->erase(it); 4512 player_map->erase(it);
4485 } 4513 }
4486 4514
4487 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { 4515 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) {
4488 force_disable_overscroll_content_ = force_disable; 4516 force_disable_overscroll_content_ = force_disable;
4489 if (view_) 4517 if (view_)
4490 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); 4518 view_->SetOverscrollControllerEnabled(CanOverscrollContent());
4491 } 4519 }
4492 4520
4493 } // namespace content 4521 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698