| 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 "content/browser/tab_contents/tab_contents.h" | 5 #include "content/browser/tab_contents/tab_contents.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| 11 #include "base/metrics/stats_counters.h" | 11 #include "base/metrics/stats_counters.h" |
| 12 #include "base/string16.h" | 12 #include "base/string16.h" |
| 13 #include "base/string_util.h" | 13 #include "base/string_util.h" |
| 14 #include "base/time.h" | 14 #include "base/time.h" |
| 15 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
| 16 #include "content/browser/browser_context.h" | 16 #include "content/browser/browser_context.h" |
| 17 #include "content/browser/child_process_security_policy.h" | 17 #include "content/browser/child_process_security_policy.h" |
| 18 #include "content/browser/debugger/devtools_manager.h" | 18 #include "content/browser/debugger/devtools_manager.h" |
| 19 #include "content/browser/download/download_manager.h" | 19 #include "content/browser/download/download_manager.h" |
| 20 #include "content/browser/download/download_stats.h" | 20 #include "content/browser/download/download_stats.h" |
| 21 #include "content/browser/host_zoom_map.h" | 21 #include "content/browser/host_zoom_map.h" |
| 22 #include "content/browser/in_process_webkit/session_storage_namespace.h" | 22 #include "content/browser/in_process_webkit/session_storage_namespace.h" |
| 23 #include "content/browser/intents/intents_host_impl.h" |
| 23 #include "content/browser/load_from_memory_cache_details.h" | 24 #include "content/browser/load_from_memory_cache_details.h" |
| 24 #include "content/browser/load_notification_details.h" | 25 #include "content/browser/load_notification_details.h" |
| 25 #include "content/browser/renderer_host/render_process_host_impl.h" | 26 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 26 #include "content/browser/renderer_host/render_view_host.h" | 27 #include "content/browser/renderer_host/render_view_host.h" |
| 27 #include "content/browser/renderer_host/render_widget_host_view.h" | 28 #include "content/browser/renderer_host/render_widget_host_view.h" |
| 28 #include "content/browser/renderer_host/resource_dispatcher_host.h" | 29 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
| 29 #include "content/browser/renderer_host/resource_request_details.h" | 30 #include "content/browser/renderer_host/resource_request_details.h" |
| 30 #include "content/browser/site_instance.h" | 31 #include "content/browser/site_instance.h" |
| 31 #include "content/browser/tab_contents/interstitial_page.h" | 32 #include "content/browser/tab_contents/interstitial_page.h" |
| 32 #include "content/browser/tab_contents/navigation_details.h" | 33 #include "content/browser/tab_contents/navigation_details.h" |
| (...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 906 const string16& href, | 907 const string16& href, |
| 907 const string16& title, | 908 const string16& title, |
| 908 const string16& disposition) { | 909 const string16& disposition) { |
| 909 delegate()->RegisterIntentHandler( | 910 delegate()->RegisterIntentHandler( |
| 910 this, action, type, href, title, disposition); | 911 this, action, type, href, title, disposition); |
| 911 } | 912 } |
| 912 | 913 |
| 913 void TabContents::OnWebIntentDispatch(const IPC::Message& message, | 914 void TabContents::OnWebIntentDispatch(const IPC::Message& message, |
| 914 const webkit_glue::WebIntentData& intent, | 915 const webkit_glue::WebIntentData& intent, |
| 915 int intent_id) { | 916 int intent_id) { |
| 916 delegate()->WebIntentDispatch(this, message.routing_id(), intent, intent_id); | 917 IntentsHostImpl* intents_host = new IntentsHostImpl(this, intent, intent_id); |
| 918 delegate()->WebIntentDispatch(this, intents_host); |
| 917 } | 919 } |
| 918 | 920 |
| 919 void TabContents::OnDidStartProvisionalLoadForFrame(int64 frame_id, | 921 void TabContents::OnDidStartProvisionalLoadForFrame(int64 frame_id, |
| 920 bool is_main_frame, | 922 bool is_main_frame, |
| 921 const GURL& opener_url, | 923 const GURL& opener_url, |
| 922 const GURL& url) { | 924 const GURL& url) { |
| 923 bool is_error_page = (url.spec() == chrome::kUnreachableWebDataURL); | 925 bool is_error_page = (url.spec() == chrome::kUnreachableWebDataURL); |
| 924 GURL validated_url(url); | 926 GURL validated_url(url); |
| 925 render_view_host()->FilterURL(ChildProcessSecurityPolicy::GetInstance(), | 927 render_view_host()->FilterURL(ChildProcessSecurityPolicy::GetInstance(), |
| 926 GetRenderProcessHost()->GetID(), &validated_url); | 928 GetRenderProcessHost()->GetID(), &validated_url); |
| (...skipping 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2038 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); | 2040 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); |
| 2039 // Can be NULL during tests. | 2041 // Can be NULL during tests. |
| 2040 if (rwh_view) | 2042 if (rwh_view) |
| 2041 rwh_view->SetSize(view()->GetContainerSize()); | 2043 rwh_view->SetSize(view()->GetContainerSize()); |
| 2042 } | 2044 } |
| 2043 | 2045 |
| 2044 bool TabContents::GotResponseToLockMouseRequest(bool allowed) { | 2046 bool TabContents::GotResponseToLockMouseRequest(bool allowed) { |
| 2045 return render_view_host() ? | 2047 return render_view_host() ? |
| 2046 render_view_host()->GotResponseToLockMouseRequest(allowed) : false; | 2048 render_view_host()->GotResponseToLockMouseRequest(allowed) : false; |
| 2047 } | 2049 } |
| OLD | NEW |