| 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" | 
| 11 #include "base/logging.h" | 11 #include "base/logging.h" | 
| 12 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" | 
| 13 #include "base/process/process.h" | 13 #include "base/process/process.h" | 
| 14 #include "base/profiler/scoped_tracker.h" | 14 #include "base/profiler/scoped_tracker.h" | 
| 15 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" | 
| 16 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" | 
| 17 #include "base/strings/string_util.h" | 17 #include "base/strings/string_util.h" | 
| 18 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" | 
| 19 #include "base/time/time.h" | 19 #include "base/time/time.h" | 
| 20 #include "base/trace_event/trace_event.h" | 20 #include "base/trace_event/trace_event.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/bad_message.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 600 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 633   IPC_END_MESSAGE_MAP() | 634   IPC_END_MESSAGE_MAP() | 
| 634   render_view_message_source_ = NULL; | 635   render_view_message_source_ = NULL; | 
| 635   render_frame_message_source_ = NULL; | 636   render_frame_message_source_ = NULL; | 
| 636 | 637 | 
| 637   return handled; | 638   return handled; | 
| 638 } | 639 } | 
| 639 | 640 | 
| 640 bool WebContentsImpl::HasValidFrameSource() { | 641 bool WebContentsImpl::HasValidFrameSource() { | 
| 641   if (!render_frame_message_source_) { | 642   if (!render_frame_message_source_) { | 
| 642     DCHECK(render_view_message_source_); | 643     DCHECK(render_view_message_source_); | 
| 643     RecordAction(base::UserMetricsAction("BadMessageTerminate_WC")); | 644     bad_message::ReceivedBadMessage(GetRenderProcessHost(), | 
| 644     GetRenderProcessHost()->ReceivedBadMessage(); | 645                                     bad_message::WC_INVALID_FRAME_SOURCE); | 
| 645     return false; | 646     return false; | 
| 646   } | 647   } | 
| 647 | 648 | 
| 648   return true; | 649   return true; | 
| 649 } | 650 } | 
| 650 | 651 | 
| 651 void WebContentsImpl::RunFileChooser( | 652 void WebContentsImpl::RunFileChooser( | 
| 652     RenderViewHost* render_view_host, | 653     RenderViewHost* render_view_host, | 
| 653     const FileChooserParams& params) { | 654     const FileChooserParams& params) { | 
| 654   if (delegate_) | 655   if (delegate_) | 
| (...skipping 3997 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 4652   node->render_manager()->ResumeResponseDeferredAtStart(); | 4653   node->render_manager()->ResumeResponseDeferredAtStart(); | 
| 4653 } | 4654 } | 
| 4654 | 4655 | 
| 4655 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4656 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 
| 4656   force_disable_overscroll_content_ = force_disable; | 4657   force_disable_overscroll_content_ = force_disable; | 
| 4657   if (view_) | 4658   if (view_) | 
| 4658     view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4659     view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 
| 4659 } | 4660 } | 
| 4660 | 4661 | 
| 4661 }  // namespace content | 4662 }  // namespace content | 
| OLD | NEW | 
|---|