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 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
729 // consistent since this is given to the plugin, so force everything to 0 | 729 // consistent since this is given to the plugin, so force everything to 0 |
730 // in the "everything is clipped" case. | 730 // in the "everything is clipped" case. |
731 gfx::Rect new_clip; | 731 gfx::Rect new_clip; |
732 if (!clip.IsEmpty()) | 732 if (!clip.IsEmpty()) |
733 new_clip = clip; | 733 new_clip = clip; |
734 | 734 |
735 // Don't notify the plugin if we've already sent these same params before. | 735 // Don't notify the plugin if we've already sent these same params before. |
736 if (sent_did_change_view_ && position == position_ && new_clip == clip_) | 736 if (sent_did_change_view_ && position == position_ && new_clip == clip_) |
737 return; | 737 return; |
738 | 738 |
739 if (desired_fullscreen_state_ || fullscreen_) { | |
740 WebKit::WebElement element = container_->element(); | |
darin (slow to review)
2011/10/14 05:03:41
nit: add a 'using WebKit::WebElement' at the top o
polina
2011/10/14 06:54:06
Done.
| |
741 WebKit::WebDocument document = element.document(); | |
742 bool is_fullscreen_element = (element == document.fullScreenElement()); | |
darin (slow to review)
2011/10/14 05:06:03
by the way, to make this easier to land, without h
polina
2011/10/14 06:54:06
Done.
| |
743 if (!fullscreen_ && desired_fullscreen_state_ && | |
744 delegate()->IsInFullscreenMode() && is_fullscreen_element) { | |
745 // Entered fullscreen. Only possible via SetFullscreen. | |
746 fullscreen_ = true; | |
747 } else if (fullscreen_ && !is_fullscreen_element) { | |
748 // Exited fullscreen. Possible via SetFullscreen or F11, | |
749 // so desired_fullscreen_state might be out-of-date. | |
750 desired_fullscreen_state_ = false; | |
751 fullscreen_ = false; | |
752 } | |
753 } | |
754 | |
739 sent_did_change_view_ = true; | 755 sent_did_change_view_ = true; |
740 position_ = position; | 756 position_ = position; |
741 clip_ = new_clip; | 757 clip_ = new_clip; |
742 fullscreen_ = desired_fullscreen_state_; | |
743 flash_fullscreen_ = (fullscreen_container_ != NULL); | 758 flash_fullscreen_ = (fullscreen_container_ != NULL); |
744 | 759 |
745 PP_Rect pp_position, pp_clip; | 760 PP_Rect pp_position, pp_clip; |
746 RectToPPRect(position_, &pp_position); | 761 RectToPPRect(position_, &pp_position); |
747 RectToPPRect(clip_, &pp_clip); | 762 RectToPPRect(clip_, &pp_clip); |
748 instance_interface_->DidChangeView(pp_instance(), &pp_position, &pp_clip); | 763 instance_interface_->DidChangeView(pp_instance(), &pp_position, &pp_clip); |
749 } | 764 } |
750 | 765 |
751 void PluginInstance::SetWebKitFocus(bool has_focus) { | 766 void PluginInstance::SetWebKitFocus(bool has_focus) { |
752 if (has_webkit_focus_ == has_focus) | 767 if (has_webkit_focus_ == has_focus) |
(...skipping 1220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1973 } | 1988 } |
1974 WebKit::WebDocument main_document = | 1989 WebKit::WebDocument main_document = |
1975 containing_document.frame()->view()->mainFrame()->document(); | 1990 containing_document.frame()->view()->mainFrame()->document(); |
1976 | 1991 |
1977 return containing_document.securityOrigin().canAccess( | 1992 return containing_document.securityOrigin().canAccess( |
1978 main_document.securityOrigin()); | 1993 main_document.securityOrigin()); |
1979 } | 1994 } |
1980 | 1995 |
1981 } // namespace ppapi | 1996 } // namespace ppapi |
1982 } // namespace webkit | 1997 } // namespace webkit |
OLD | NEW |