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 "content/browser/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 #include "ui/base/layout.h" | 101 #include "ui/base/layout.h" |
102 #include "ui/gfx/display.h" | 102 #include "ui/gfx/display.h" |
103 #include "ui/gfx/screen.h" | 103 #include "ui/gfx/screen.h" |
104 #include "ui/gl/gl_switches.h" | 104 #include "ui/gl/gl_switches.h" |
105 | 105 |
106 #if defined(ENABLE_BROWSER_CDMS) | 106 #if defined(ENABLE_BROWSER_CDMS) |
107 #include "content/browser/media/media_web_contents_observer.h" | 107 #include "content/browser/media/media_web_contents_observer.h" |
108 #endif | 108 #endif |
109 | 109 |
110 #if defined(OS_ANDROID) | 110 #if defined(OS_ANDROID) |
| 111 #include "content/browser/android/content_video_view.h" |
111 #include "content/browser/android/date_time_chooser_android.h" | 112 #include "content/browser/android/date_time_chooser_android.h" |
112 #include "content/browser/media/android/browser_media_player_manager.h" | 113 #include "content/browser/media/android/browser_media_player_manager.h" |
113 #include "content/browser/web_contents/web_contents_android.h" | 114 #include "content/browser/web_contents/web_contents_android.h" |
114 #endif | 115 #endif |
115 | 116 |
116 #if defined(OS_MACOSX) | 117 #if defined(OS_MACOSX) |
117 #include "base/mac/foundation_util.h" | 118 #include "base/mac/foundation_util.h" |
118 #endif | 119 #endif |
119 | 120 |
120 namespace content { | 121 namespace content { |
(...skipping 1357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1478 DidToggleFullscreenModeForTab(IsFullscreenForCurrentTab())); | 1479 DidToggleFullscreenModeForTab(IsFullscreenForCurrentTab())); |
1479 } | 1480 } |
1480 | 1481 |
1481 void WebContentsImpl::ExitFullscreenMode() { | 1482 void WebContentsImpl::ExitFullscreenMode() { |
1482 // This method is being called to leave renderer-initiated fullscreen mode. | 1483 // This method is being called to leave renderer-initiated fullscreen mode. |
1483 // Make sure any existing fullscreen widget is shut down first. | 1484 // Make sure any existing fullscreen widget is shut down first. |
1484 RenderWidgetHostView* const widget_view = GetFullscreenRenderWidgetHostView(); | 1485 RenderWidgetHostView* const widget_view = GetFullscreenRenderWidgetHostView(); |
1485 if (widget_view) | 1486 if (widget_view) |
1486 RenderWidgetHostImpl::From(widget_view->GetRenderWidgetHost())->Shutdown(); | 1487 RenderWidgetHostImpl::From(widget_view->GetRenderWidgetHost())->Shutdown(); |
1487 | 1488 |
| 1489 #if defined(OS_ANDROID) |
| 1490 ContentVideoView* video_view = ContentVideoView::GetInstance(); |
| 1491 if (video_view != NULL) |
| 1492 video_view->OnExitFullscreen(); |
| 1493 #endif |
| 1494 |
1488 if (delegate_) | 1495 if (delegate_) |
1489 delegate_->ExitFullscreenModeForTab(this); | 1496 delegate_->ExitFullscreenModeForTab(this); |
1490 | 1497 |
1491 FOR_EACH_OBSERVER(WebContentsObserver, | 1498 FOR_EACH_OBSERVER(WebContentsObserver, |
1492 observers_, | 1499 observers_, |
1493 DidToggleFullscreenModeForTab(IsFullscreenForCurrentTab())); | 1500 DidToggleFullscreenModeForTab(IsFullscreenForCurrentTab())); |
1494 } | 1501 } |
1495 | 1502 |
1496 bool WebContentsImpl::IsFullscreenForCurrentTab() const { | 1503 bool WebContentsImpl::IsFullscreenForCurrentTab() const { |
1497 return delegate_ ? delegate_->IsFullscreenForTabOrPending(this) : false; | 1504 return delegate_ ? delegate_->IsFullscreenForTabOrPending(this) : false; |
(...skipping 2976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4474 node->render_manager()->ResumeResponseDeferredAtStart(); | 4481 node->render_manager()->ResumeResponseDeferredAtStart(); |
4475 } | 4482 } |
4476 | 4483 |
4477 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4484 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
4478 force_disable_overscroll_content_ = force_disable; | 4485 force_disable_overscroll_content_ = force_disable; |
4479 if (view_) | 4486 if (view_) |
4480 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4487 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
4481 } | 4488 } |
4482 | 4489 |
4483 } // namespace content | 4490 } // namespace content |
OLD | NEW |