OLD | NEW |
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 "webkit/media/android/webmediaplayer_android.h" | 5 #include "webkit/media/android/webmediaplayer_android.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "cc/layers/video_layer.h" | 10 #include "cc/layers/video_layer.h" |
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 } | 469 } |
470 | 470 |
471 void WebMediaPlayerAndroid::SetNeedsEstablishPeer(bool needs_establish_peer) { | 471 void WebMediaPlayerAndroid::SetNeedsEstablishPeer(bool needs_establish_peer) { |
472 needs_establish_peer_ = needs_establish_peer; | 472 needs_establish_peer_ = needs_establish_peer; |
473 } | 473 } |
474 | 474 |
475 void WebMediaPlayerAndroid::UpdatePlayingState(bool is_playing) { | 475 void WebMediaPlayerAndroid::UpdatePlayingState(bool is_playing) { |
476 is_playing_ = is_playing; | 476 is_playing_ = is_playing; |
477 } | 477 } |
478 | 478 |
| 479 bool WebMediaPlayerAndroid::GetGeometryChange(gfx::RectF* rect) { |
| 480 if (!video_weblayer_) |
| 481 return false; |
| 482 |
| 483 cc::Layer* layer = video_weblayer_->layer(); |
| 484 rect->set_size(layer->bounds()); |
| 485 while (layer) { |
| 486 rect->Offset(layer->position().OffsetFromOrigin()); |
| 487 layer = layer->parent(); |
| 488 } |
| 489 |
| 490 if (rect_ == *rect) |
| 491 return false; |
| 492 |
| 493 rect_ = *rect; |
| 494 return true; |
| 495 } |
| 496 |
479 } // namespace webkit_media | 497 } // namespace webkit_media |
OLD | NEW |