| OLD | NEW |
| 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/browser/media/android/browser_media_player_manager.h" | 5 #include "content/browser/media/android/browser_media_player_manager.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/android/scoped_java_ref.h" | 9 #include "base/android/scoped_java_ref.h" |
| 10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 natural_video_size = | 434 natural_video_size = |
| 435 gfx::Size(player->GetVideoWidth(), player->GetVideoHeight()); | 435 gfx::Size(player->GetVideoWidth(), player->GetVideoHeight()); |
| 436 } | 436 } |
| 437 | 437 |
| 438 if (!web_contents()->GetDelegate()) | 438 if (!web_contents()->GetDelegate()) |
| 439 return; | 439 return; |
| 440 | 440 |
| 441 base::android::ScopedJavaLocalRef<jobject> embedder( | 441 base::android::ScopedJavaLocalRef<jobject> embedder( |
| 442 web_contents()->GetDelegate()->GetContentVideoViewEmbedder()); | 442 web_contents()->GetDelegate()->GetContentVideoViewEmbedder()); |
| 443 video_view_.reset( | 443 video_view_.reset( |
| 444 new ContentVideoView(this, | 444 new ContentVideoView(GetContentViewCore(), |
| 445 GetContentViewCore(), | 445 embedder)); |
| 446 embedder, | 446 video_view_->CreateVideoSurface(this, natural_video_size); |
| 447 natural_video_size)); | |
| 448 | 447 |
| 449 base::android::ScopedJavaLocalRef<jobject> j_content_video_view = | 448 base::android::ScopedJavaLocalRef<jobject> j_content_video_view = |
| 450 video_view_->GetJavaObject(base::android::AttachCurrentThread()); | 449 video_view_->GetJavaObject(base::android::AttachCurrentThread()); |
| 451 if (!j_content_video_view.is_null()) { | 450 if (!j_content_video_view.is_null()) { |
| 452 fullscreen_player_id_ = player_id; | 451 fullscreen_player_id_ = player_id; |
| 453 } else { | 452 } else { |
| 454 Send(new MediaPlayerMsg_DidExitFullscreen(RoutingID(), player_id)); | 453 Send(new MediaPlayerMsg_DidExitFullscreen(RoutingID(), player_id)); |
| 455 video_view_.reset(); | 454 video_view_.reset(); |
| 456 } | 455 } |
| 457 #endif // defined(USE_AURA) | 456 #endif // defined(USE_AURA) |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 666 if (!player) | 665 if (!player) |
| 667 return; | 666 return; |
| 668 player->Start(); | 667 player->Start(); |
| 669 if (fullscreen_player_id_ == player_id && fullscreen_player_is_released_) { | 668 if (fullscreen_player_id_ == player_id && fullscreen_player_is_released_) { |
| 670 video_view_->OpenVideo(); | 669 video_view_->OpenVideo(); |
| 671 fullscreen_player_is_released_ = false; | 670 fullscreen_player_is_released_ = false; |
| 672 } | 671 } |
| 673 } | 672 } |
| 674 | 673 |
| 675 } // namespace content | 674 } // namespace content |
| OLD | NEW |