Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/browser_plugin/browser_plugin_guest_manager.h" | 5 #include "content/browser/browser_plugin/browser_plugin_guest_manager.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "content/browser/browser_plugin/browser_plugin_guest.h" | 8 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
| 9 #include "content/browser/browser_plugin/browser_plugin_host_factory.h" | 9 #include "content/browser/browser_plugin/browser_plugin_host_factory.h" |
| 10 #include "content/browser/renderer_host/render_view_host_impl.h" | 10 #include "content/browser/renderer_host/render_view_host_impl.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 63 // iframes instead. We use the src URL sent by the renderer to find the | 63 // iframes instead. We use the src URL sent by the renderer to find the |
| 64 // right process in which to place this instance. | 64 // right process in which to place this instance. |
| 65 // Note: Since BrowserPlugin doesn't support cross-process navigation, | 65 // Note: Since BrowserPlugin doesn't support cross-process navigation, |
| 66 // the instance will stay in the initially assigned process, regardless | 66 // the instance will stay in the initially assigned process, regardless |
| 67 // of the site it is navigated to. | 67 // of the site it is navigated to. |
| 68 // TODO(nasko): Fix this, and such that cross-process navigations are | 68 // TODO(nasko): Fix this, and such that cross-process navigations are |
| 69 // supported. | 69 // supported. |
| 70 guest_site_instance = | 70 guest_site_instance = |
| 71 embedder_site_instance->GetRelatedSiteInstance(GURL(params.src)); | 71 embedder_site_instance->GetRelatedSiteInstance(GURL(params.src)); |
| 72 } else { | 72 } else { |
| 73 const std::string& host = embedder_site_instance->GetSiteURL().host(); | 73 const std::string& host = GURL(params.embedder_frame_url).host(); |
|
Fady Samuel
2013/09/12 21:54:38
Wow, this is a bit scary. You should only be doing
guohui
2013/09/12 22:06:08
We got the frame URL
you mean the frame URL we go
Fady Samuel
2013/09/12 22:11:21
The embedder's site instance is a URL generated by
guohui
2013/09/12 22:36:12
that makes sense, thanks! fixed as suggested.
| |
| 74 | 74 |
| 75 std::string url_encoded_partition = net::EscapeQueryParamValue( | 75 std::string url_encoded_partition = net::EscapeQueryParamValue( |
| 76 params.storage_partition_id, false); | 76 params.storage_partition_id, false); |
| 77 // The SiteInstance of a given webview tag is based on the fact that it's | 77 // The SiteInstance of a given webview tag is based on the fact that it's |
| 78 // a guest process in addition to which platform application the tag | 78 // a guest process in addition to which platform application the tag |
| 79 // belongs to and what storage partition is in use, rather than the URL | 79 // belongs to and what storage partition is in use, rather than the URL |
| 80 // that the tag is being navigated to. | 80 // that the tag is being navigated to. |
| 81 GURL guest_site( | 81 GURL guest_site( |
| 82 base::StringPrintf("%s://%s/%s?%s", chrome::kGuestScheme, | 82 base::StringPrintf("%s://%s/%s?%s", chrome::kGuestScheme, |
| 83 host.c_str(), | 83 host.c_str(), |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 265 BrowserPluginGuest* guest = it->second->GetBrowserPluginGuest(); | 265 BrowserPluginGuest* guest = it->second->GetBrowserPluginGuest(); |
| 266 if (embedder_web_contents == guest->embedder_web_contents()) { | 266 if (embedder_web_contents == guest->embedder_web_contents()) { |
| 267 if (guest->UnlockMouseIfNecessary(event)) | 267 if (guest->UnlockMouseIfNecessary(event)) |
| 268 return true; | 268 return true; |
| 269 } | 269 } |
| 270 } | 270 } |
| 271 return false; | 271 return false; |
| 272 } | 272 } |
| 273 | 273 |
| 274 } // namespace content | 274 } // namespace content |
| OLD | NEW |