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

Side by Side Diff: content/renderer/media/android/webmediaplayer_android.cc

Issue 135863004: Downloads and passes the poster image to Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Anton & Aaron's comments Created 6 years, 10 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/renderer/media/android/webmediaplayer_android.h" 5 #include "content/renderer/media/android/webmediaplayer_android.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 18 matching lines...) Expand all
29 #include "gpu/command_buffer/client/gles2_interface.h" 29 #include "gpu/command_buffer/client/gles2_interface.h"
30 #include "gpu/command_buffer/common/mailbox_holder.h" 30 #include "gpu/command_buffer/common/mailbox_holder.h"
31 #include "grit/content_resources.h" 31 #include "grit/content_resources.h"
32 #include "media/base/android/media_player_android.h" 32 #include "media/base/android/media_player_android.h"
33 #include "media/base/bind_to_current_loop.h" 33 #include "media/base/bind_to_current_loop.h"
34 #include "media/base/media_switches.h" 34 #include "media/base/media_switches.h"
35 #include "media/base/video_frame.h" 35 #include "media/base/video_frame.h"
36 #include "net/base/mime_util.h" 36 #include "net/base/mime_util.h"
37 #include "third_party/WebKit/public/platform/WebMediaPlayerClient.h" 37 #include "third_party/WebKit/public/platform/WebMediaPlayerClient.h"
38 #include "third_party/WebKit/public/platform/WebString.h" 38 #include "third_party/WebKit/public/platform/WebString.h"
39 #include "third_party/WebKit/public/platform/WebURL.h"
39 #include "third_party/WebKit/public/web/WebDocument.h" 40 #include "third_party/WebKit/public/web/WebDocument.h"
40 #include "third_party/WebKit/public/web/WebFrame.h" 41 #include "third_party/WebKit/public/web/WebFrame.h"
41 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" 42 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h"
42 #include "third_party/WebKit/public/web/WebView.h" 43 #include "third_party/WebKit/public/web/WebView.h"
43 #include "third_party/skia/include/core/SkBitmap.h" 44 #include "third_party/skia/include/core/SkBitmap.h"
44 #include "third_party/skia/include/core/SkCanvas.h" 45 #include "third_party/skia/include/core/SkCanvas.h"
45 #include "third_party/skia/include/core/SkPaint.h" 46 #include "third_party/skia/include/core/SkPaint.h"
46 #include "ui/gfx/image/image.h" 47 #include "ui/gfx/image/image.h"
47 #include "webkit/renderer/compositor_bindings/web_layer_impl.h" 48 #include "webkit/renderer/compositor_bindings/web_layer_impl.h"
48 49
(...skipping 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after
1050 kGLTextureExternalOES, 1051 kGLTextureExternalOES,
1051 &texture_id_, 1052 &texture_id_,
1052 &texture_mailbox_, 1053 &texture_mailbox_,
1053 &texture_mailbox_sync_point_); 1054 &texture_mailbox_sync_point_);
1054 } 1055 }
1055 1056
1056 void WebMediaPlayerAndroid::SetNeedsEstablishPeer(bool needs_establish_peer) { 1057 void WebMediaPlayerAndroid::SetNeedsEstablishPeer(bool needs_establish_peer) {
1057 needs_establish_peer_ = needs_establish_peer; 1058 needs_establish_peer_ = needs_establish_peer;
1058 } 1059 }
1059 1060
1061 void WebMediaPlayerAndroid::setPoster(const blink::WebURL& poster) {
1062 manager_->SetPoster(player_id_, poster);
1063 }
1064
1060 void WebMediaPlayerAndroid::UpdatePlayingState(bool is_playing) { 1065 void WebMediaPlayerAndroid::UpdatePlayingState(bool is_playing) {
1061 is_playing_ = is_playing; 1066 is_playing_ = is_playing;
1062 if (!delegate_) 1067 if (!delegate_)
1063 return; 1068 return;
1064 if (is_playing) 1069 if (is_playing)
1065 delegate_->DidPlay(this); 1070 delegate_->DidPlay(this);
1066 else 1071 else
1067 delegate_->DidPause(this); 1072 delegate_->DidPause(this);
1068 } 1073 }
1069 1074
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
1404 1409
1405 void WebMediaPlayerAndroid::exitFullscreen() { 1410 void WebMediaPlayerAndroid::exitFullscreen() {
1406 manager_->ExitFullscreen(player_id_); 1411 manager_->ExitFullscreen(player_id_);
1407 } 1412 }
1408 1413
1409 bool WebMediaPlayerAndroid::canEnterFullscreen() const { 1414 bool WebMediaPlayerAndroid::canEnterFullscreen() const {
1410 return manager_->CanEnterFullscreen(frame_); 1415 return manager_->CanEnterFullscreen(frame_);
1411 } 1416 }
1412 1417
1413 } // namespace content 1418 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698