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/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
11 #include "base/lazy_instance.h" | 11 #include "base/lazy_instance.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
14 #include "base/metrics/stats_counters.h" | 14 #include "base/metrics/stats_counters.h" |
15 #include "base/process/process.h" | 15 #include "base/process/process.h" |
16 #include "base/strings/string16.h" | 16 #include "base/strings/string16.h" |
17 #include "base/strings/string_number_conversions.h" | 17 #include "base/strings/string_number_conversions.h" |
18 #include "base/strings/string_util.h" | 18 #include "base/strings/string_util.h" |
19 #include "base/strings/utf_string_conversions.h" | 19 #include "base/strings/utf_string_conversions.h" |
20 #include "base/time/time.h" | 20 #include "base/time/time.h" |
21 #include "content/browser/accessibility/accessibility_mode_helper.h" | 21 #include "content/browser/accessibility/accessibility_mode_helper.h" |
22 #include "content/browser/accessibility/browser_accessibility_state_impl.h" | 22 #include "content/browser/accessibility/browser_accessibility_state_impl.h" |
| 23 #include "content/browser/android/content_video_view.h" |
23 #include "content/browser/browser_plugin/browser_plugin_embedder.h" | 24 #include "content/browser/browser_plugin/browser_plugin_embedder.h" |
24 #include "content/browser/browser_plugin/browser_plugin_guest.h" | 25 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
25 #include "content/browser/child_process_security_policy_impl.h" | 26 #include "content/browser/child_process_security_policy_impl.h" |
26 #include "content/browser/devtools/devtools_manager.h" | 27 #include "content/browser/devtools/devtools_manager.h" |
27 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" | 28 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" |
28 #include "content/browser/dom_storage/session_storage_namespace_impl.h" | 29 #include "content/browser/dom_storage/session_storage_namespace_impl.h" |
29 #include "content/browser/download/download_stats.h" | 30 #include "content/browser/download/download_stats.h" |
30 #include "content/browser/download/mhtml_generation_manager.h" | 31 #include "content/browser/download/mhtml_generation_manager.h" |
31 #include "content/browser/download/save_package.h" | 32 #include "content/browser/download/save_package.h" |
32 #include "content/browser/frame_host/cross_process_frame_connector.h" | 33 #include "content/browser/frame_host/cross_process_frame_connector.h" |
(...skipping 1433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1466 DidToggleFullscreenModeForTab(IsFullscreenForCurrentTab())); | 1467 DidToggleFullscreenModeForTab(IsFullscreenForCurrentTab())); |
1467 } | 1468 } |
1468 | 1469 |
1469 void WebContentsImpl::ExitFullscreenMode() { | 1470 void WebContentsImpl::ExitFullscreenMode() { |
1470 // This method is being called to leave renderer-initiated fullscreen mode. | 1471 // This method is being called to leave renderer-initiated fullscreen mode. |
1471 // Make sure any existing fullscreen widget is shut down first. | 1472 // Make sure any existing fullscreen widget is shut down first. |
1472 RenderWidgetHostView* const widget_view = GetFullscreenRenderWidgetHostView(); | 1473 RenderWidgetHostView* const widget_view = GetFullscreenRenderWidgetHostView(); |
1473 if (widget_view) | 1474 if (widget_view) |
1474 RenderWidgetHostImpl::From(widget_view->GetRenderWidgetHost())->Shutdown(); | 1475 RenderWidgetHostImpl::From(widget_view->GetRenderWidgetHost())->Shutdown(); |
1475 | 1476 |
| 1477 #if defined(OS_ANDROID) |
| 1478 ContentVideoView* video_view = ContentVideoView::GetInstance(); |
| 1479 if (video_view != NULL) |
| 1480 video_view->OnExitFullscreen(); |
| 1481 #endif |
| 1482 |
1476 if (delegate_) | 1483 if (delegate_) |
1477 delegate_->ExitFullscreenModeForTab(this); | 1484 delegate_->ExitFullscreenModeForTab(this); |
1478 | 1485 |
1479 FOR_EACH_OBSERVER(WebContentsObserver, | 1486 FOR_EACH_OBSERVER(WebContentsObserver, |
1480 observers_, | 1487 observers_, |
1481 DidToggleFullscreenModeForTab(IsFullscreenForCurrentTab())); | 1488 DidToggleFullscreenModeForTab(IsFullscreenForCurrentTab())); |
1482 } | 1489 } |
1483 | 1490 |
1484 bool WebContentsImpl::IsFullscreenForCurrentTab() const { | 1491 bool WebContentsImpl::IsFullscreenForCurrentTab() const { |
1485 return delegate_ ? delegate_->IsFullscreenForTabOrPending(this) : false; | 1492 return delegate_ ? delegate_->IsFullscreenForTabOrPending(this) : false; |
(...skipping 2964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4450 node->render_manager()->ResumeResponseDeferredAtStart(); | 4457 node->render_manager()->ResumeResponseDeferredAtStart(); |
4451 } | 4458 } |
4452 | 4459 |
4453 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4460 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
4454 force_disable_overscroll_content_ = force_disable; | 4461 force_disable_overscroll_content_ = force_disable; |
4455 if (view_) | 4462 if (view_) |
4456 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4463 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
4457 } | 4464 } |
4458 | 4465 |
4459 } // namespace content | 4466 } // namespace content |
OLD | NEW |