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/browser_plugin/browser_plugin_embedder.h" | 21 #include "content/browser/browser_plugin/browser_plugin_embedder.h" |
22 #include "content/browser/browser_plugin/browser_plugin_guest.h" | 22 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
23 #include "content/browser/browser_plugin/browser_plugin_guest_manager.h" | |
24 #include "content/browser/child_process_security_policy_impl.h" | 23 #include "content/browser/child_process_security_policy_impl.h" |
25 #include "content/browser/devtools/render_view_devtools_agent_host.h" | 24 #include "content/browser/devtools/render_view_devtools_agent_host.h" |
26 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" | 25 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" |
27 #include "content/browser/dom_storage/session_storage_namespace_impl.h" | 26 #include "content/browser/dom_storage/session_storage_namespace_impl.h" |
28 #include "content/browser/download/download_stats.h" | 27 #include "content/browser/download/download_stats.h" |
29 #include "content/browser/download/mhtml_generation_manager.h" | 28 #include "content/browser/download/mhtml_generation_manager.h" |
30 #include "content/browser/download/save_package.h" | 29 #include "content/browser/download/save_package.h" |
31 #include "content/browser/frame_host/cross_process_frame_connector.h" | 30 #include "content/browser/frame_host/cross_process_frame_connector.h" |
32 #include "content/browser/frame_host/interstitial_page_impl.h" | 31 #include "content/browser/frame_host/interstitial_page_impl.h" |
33 #include "content/browser/frame_host/navigation_entry_impl.h" | 32 #include "content/browser/frame_host/navigation_entry_impl.h" |
(...skipping 17 matching lines...) Expand all Loading... | |
51 #include "content/common/browser_plugin/browser_plugin_constants.h" | 50 #include "content/common/browser_plugin/browser_plugin_constants.h" |
52 #include "content/common/browser_plugin/browser_plugin_messages.h" | 51 #include "content/common/browser_plugin/browser_plugin_messages.h" |
53 #include "content/common/frame_messages.h" | 52 #include "content/common/frame_messages.h" |
54 #include "content/common/image_messages.h" | 53 #include "content/common/image_messages.h" |
55 #include "content/common/input_messages.h" | 54 #include "content/common/input_messages.h" |
56 #include "content/common/ssl_status_serialization.h" | 55 #include "content/common/ssl_status_serialization.h" |
57 #include "content/common/view_messages.h" | 56 #include "content/common/view_messages.h" |
58 #include "content/port/browser/render_view_host_delegate_view.h" | 57 #include "content/port/browser/render_view_host_delegate_view.h" |
59 #include "content/public/browser/ax_event_notification_details.h" | 58 #include "content/public/browser/ax_event_notification_details.h" |
60 #include "content/public/browser/browser_context.h" | 59 #include "content/public/browser/browser_context.h" |
60 #include "content/public/browser/browser_plugin_guest_manager_delegate.h" | |
61 #include "content/public/browser/content_browser_client.h" | 61 #include "content/public/browser/content_browser_client.h" |
62 #include "content/public/browser/devtools_agent_host.h" | 62 #include "content/public/browser/devtools_agent_host.h" |
63 #include "content/public/browser/download_manager.h" | 63 #include "content/public/browser/download_manager.h" |
64 #include "content/public/browser/download_url_parameters.h" | 64 #include "content/public/browser/download_url_parameters.h" |
65 #include "content/public/browser/invalidate_type.h" | 65 #include "content/public/browser/invalidate_type.h" |
66 #include "content/public/browser/javascript_dialog_manager.h" | 66 #include "content/public/browser/javascript_dialog_manager.h" |
67 #include "content/public/browser/load_from_memory_cache_details.h" | 67 #include "content/public/browser/load_from_memory_cache_details.h" |
68 #include "content/public/browser/load_notification_details.h" | 68 #include "content/public/browser/load_notification_details.h" |
69 #include "content/public/browser/navigation_details.h" | 69 #include "content/public/browser/navigation_details.h" |
70 #include "content/public/browser/notification_details.h" | 70 #include "content/public/browser/notification_details.h" |
(...skipping 1340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1411 CreateParams create_params(GetBrowserContext(), site_instance.get()); | 1411 CreateParams create_params(GetBrowserContext(), site_instance.get()); |
1412 create_params.routing_id = route_id; | 1412 create_params.routing_id = route_id; |
1413 create_params.main_frame_routing_id = main_frame_route_id; | 1413 create_params.main_frame_routing_id = main_frame_route_id; |
1414 if (!is_guest) { | 1414 if (!is_guest) { |
1415 create_params.context = view_->GetNativeView(); | 1415 create_params.context = view_->GetNativeView(); |
1416 create_params.initial_size = GetContainerBounds().size(); | 1416 create_params.initial_size = GetContainerBounds().size(); |
1417 } else { | 1417 } else { |
1418 // This makes |new_contents| act as a guest. | 1418 // This makes |new_contents| act as a guest. |
1419 // For more info, see comment above class BrowserPluginGuest. | 1419 // For more info, see comment above class BrowserPluginGuest. |
1420 int instance_id = | 1420 int instance_id = |
1421 BrowserPluginGuestManager::FromBrowserContext(GetBrowserContext())-> | 1421 GetBrowserContext()->GetGuestManagerDelegate()-> |
1422 GetNextInstanceID(); | 1422 GetNextInstanceID(); |
lazyboy
2014/05/05 21:40:54
nit: fits in previous line.
Fady Samuel
2014/05/07 17:32:59
Done.
| |
1423 WebContentsImpl* new_contents_impl = | 1423 WebContentsImpl* new_contents_impl = |
1424 static_cast<WebContentsImpl*>(new_contents); | 1424 static_cast<WebContentsImpl*>(new_contents); |
1425 BrowserPluginGuest::CreateWithOpener(instance_id, | 1425 BrowserPluginGuest::CreateWithOpener(instance_id, |
1426 new_contents_impl->opener() != NULL, | 1426 new_contents_impl->opener() != NULL, |
1427 new_contents_impl, | 1427 new_contents_impl, |
1428 GetBrowserPluginGuest()); | 1428 GetBrowserPluginGuest()); |
1429 } | 1429 } |
1430 if (params.disposition == NEW_BACKGROUND_TAB) | 1430 if (params.disposition == NEW_BACKGROUND_TAB) |
1431 create_params.initially_hidden = true; | 1431 create_params.initially_hidden = true; |
1432 new_contents->Init(create_params); | 1432 new_contents->Init(create_params); |
(...skipping 2540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3973 | 3973 |
3974 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { | 3974 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { |
3975 if (!delegate_) | 3975 if (!delegate_) |
3976 return; | 3976 return; |
3977 const gfx::Size new_size = GetPreferredSize(); | 3977 const gfx::Size new_size = GetPreferredSize(); |
3978 if (new_size != old_size) | 3978 if (new_size != old_size) |
3979 delegate_->UpdatePreferredSize(this, new_size); | 3979 delegate_->UpdatePreferredSize(this, new_size); |
3980 } | 3980 } |
3981 | 3981 |
3982 } // namespace content | 3982 } // namespace content |
OLD | NEW |