OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/plugins/ppapi/ppapi_plugin_instance.h" | 5 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
734 if (!clip.IsEmpty()) | 734 if (!clip.IsEmpty()) |
735 new_clip = clip; | 735 new_clip = clip; |
736 | 736 |
737 // Don't notify the plugin if we've already sent these same params before. | 737 // Don't notify the plugin if we've already sent these same params before. |
738 if (sent_did_change_view_ && position == position_ && new_clip == clip_) | 738 if (sent_did_change_view_ && position == position_ && new_clip == clip_) |
739 return; | 739 return; |
740 | 740 |
741 if (desired_fullscreen_state_ || fullscreen_) { | 741 if (desired_fullscreen_state_ || fullscreen_) { |
742 WebElement element = container_->element(); | 742 WebElement element = container_->element(); |
743 WebDocument document = element.document(); | 743 WebDocument document = element.document(); |
744 // TODO(polina): temporary hack to ease WebKit/Chromium commit sequence. | |
745 #ifdef WEBKIT_WEBDOCUMENT_HAS_FULLSCREENELEMENT | |
746 bool is_fullscreen_element = (element == document.fullScreenElement()); | 744 bool is_fullscreen_element = (element == document.fullScreenElement()); |
747 #else | |
748 bool is_fullscreen_element = desired_fullscreen_state_; | |
749 #endif | |
750 if (!fullscreen_ && desired_fullscreen_state_ && | 745 if (!fullscreen_ && desired_fullscreen_state_ && |
751 delegate()->IsInFullscreenMode() && is_fullscreen_element) { | 746 delegate()->IsInFullscreenMode() && is_fullscreen_element) { |
752 // Entered fullscreen. Only possible via SetFullscreen(). | 747 // Entered fullscreen. Only possible via SetFullscreen(). |
753 fullscreen_ = true; | 748 fullscreen_ = true; |
754 } else if (fullscreen_ && !is_fullscreen_element) { | 749 } else if (fullscreen_ && !is_fullscreen_element) { |
755 // Exited fullscreen. Possible via SetFullscreen() or F11/link, | 750 // Exited fullscreen. Possible via SetFullscreen() or F11/link, |
756 // so desired_fullscreen_state might be out-of-date. | 751 // so desired_fullscreen_state might be out-of-date. |
757 desired_fullscreen_state_ = false; | 752 desired_fullscreen_state_ = false; |
758 fullscreen_ = false; | 753 fullscreen_ = false; |
759 // Reset the size attributes that we hacked to fill in the screen and | 754 // Reset the size attributes that we hacked to fill in the screen and |
(...skipping 1282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2042 screen_size_for_fullscreen_ = gfx::Size(); | 2037 screen_size_for_fullscreen_ = gfx::Size(); |
2043 WebElement element = container_->element(); | 2038 WebElement element = container_->element(); |
2044 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); | 2039 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); |
2045 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); | 2040 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); |
2046 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); | 2041 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); |
2047 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); | 2042 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); |
2048 } | 2043 } |
2049 | 2044 |
2050 } // namespace ppapi | 2045 } // namespace ppapi |
2051 } // namespace webkit | 2046 } // namespace webkit |
OLD | NEW |