| 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/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1029 } | 1029 } |
| 1030 | 1030 |
| 1031 WebContents* WebContentsImpl::Clone() { | 1031 WebContents* WebContentsImpl::Clone() { |
| 1032 // We use our current SiteInstance since the cloned entry will use it anyway. | 1032 // We use our current SiteInstance since the cloned entry will use it anyway. |
| 1033 // We pass |this| for the |base_web_contents| to size the view correctly, and | 1033 // We pass |this| for the |base_web_contents| to size the view correctly, and |
| 1034 // our own opener so that the cloned page can access it if it was before. | 1034 // our own opener so that the cloned page can access it if it was before. |
| 1035 WebContentsImpl* tc = CreateWithOpener(GetBrowserContext(), | 1035 WebContentsImpl* tc = CreateWithOpener(GetBrowserContext(), |
| 1036 GetSiteInstance(), MSG_ROUTING_NONE, | 1036 GetSiteInstance(), MSG_ROUTING_NONE, |
| 1037 this, opener_); | 1037 this, opener_); |
| 1038 tc->GetController().CopyStateFrom(controller_); | 1038 tc->GetController().CopyStateFrom(controller_); |
| 1039 FOR_EACH_OBSERVER(WebContentsObserver, |
| 1040 observers_, |
| 1041 DidCloneToNewWebContents(this, tc)); |
| 1039 return tc; | 1042 return tc; |
| 1040 } | 1043 } |
| 1041 | 1044 |
| 1042 gfx::NativeView WebContentsImpl::GetContentNativeView() const { | 1045 gfx::NativeView WebContentsImpl::GetContentNativeView() const { |
| 1043 return view_->GetContentNativeView(); | 1046 return view_->GetContentNativeView(); |
| 1044 } | 1047 } |
| 1045 | 1048 |
| 1046 gfx::NativeView WebContentsImpl::GetNativeView() const { | 1049 gfx::NativeView WebContentsImpl::GetNativeView() const { |
| 1047 return view_->GetNativeView(); | 1050 return view_->GetNativeView(); |
| 1048 } | 1051 } |
| (...skipping 2235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3284 old_browser_plugin_host()->embedder_render_process_host(); | 3287 old_browser_plugin_host()->embedder_render_process_host(); |
| 3285 *embedder_container_id = old_browser_plugin_host()->instance_id(); | 3288 *embedder_container_id = old_browser_plugin_host()->instance_id(); |
| 3286 int embedder_process_id = | 3289 int embedder_process_id = |
| 3287 embedder_render_process_host ? embedder_render_process_host->GetID() : -1; | 3290 embedder_render_process_host ? embedder_render_process_host->GetID() : -1; |
| 3288 if (embedder_process_id != -1) { | 3291 if (embedder_process_id != -1) { |
| 3289 *embedder_channel_name = | 3292 *embedder_channel_name = |
| 3290 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(), | 3293 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(), |
| 3291 embedder_process_id); | 3294 embedder_process_id); |
| 3292 } | 3295 } |
| 3293 } | 3296 } |
| OLD | NEW |