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" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 #include "content/common/browser_plugin/browser_plugin_constants.h" | 50 #include "content/common/browser_plugin/browser_plugin_constants.h" |
51 #include "content/common/browser_plugin/browser_plugin_messages.h" | 51 #include "content/common/browser_plugin/browser_plugin_messages.h" |
52 #include "content/common/frame_messages.h" | 52 #include "content/common/frame_messages.h" |
53 #include "content/common/image_messages.h" | 53 #include "content/common/image_messages.h" |
54 #include "content/common/input_messages.h" | 54 #include "content/common/input_messages.h" |
55 #include "content/common/ssl_status_serialization.h" | 55 #include "content/common/ssl_status_serialization.h" |
56 #include "content/common/view_messages.h" | 56 #include "content/common/view_messages.h" |
57 #include "content/port/browser/render_view_host_delegate_view.h" | 57 #include "content/port/browser/render_view_host_delegate_view.h" |
58 #include "content/public/browser/ax_event_notification_details.h" | 58 #include "content/public/browser/ax_event_notification_details.h" |
59 #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" | 60 #include "content/public/browser/browser_plugin_guest_manager.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 GetBrowserContext()->GetGuestManagerDelegate()-> | 1421 GetBrowserContext()->GetGuestManager()-> |
1422 GetNextInstanceID(); | 1422 GetNextInstanceID(); |
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; |
(...skipping 2541 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 |