Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/guest_view/web_view/web_view_guest.h" | 5 #include "chrome/browser/guest_view/web_view/web_view_guest.h" |
| 6 | 6 |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| (...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1110 } | 1110 } |
| 1111 DCHECK(embedder_extension_id() == partition_domain); | 1111 DCHECK(embedder_extension_id() == partition_domain); |
| 1112 | 1112 |
| 1113 ExtensionRendererState::WebViewInfo webview_info; | 1113 ExtensionRendererState::WebViewInfo webview_info; |
| 1114 webview_info.embedder_process_id = embedder_render_process_id(); | 1114 webview_info.embedder_process_id = embedder_render_process_id(); |
| 1115 webview_info.instance_id = view_instance_id(); | 1115 webview_info.instance_id = view_instance_id(); |
| 1116 webview_info.partition_id = partition_id; | 1116 webview_info.partition_id = partition_id; |
| 1117 webview_info.embedder_extension_id = embedder_extension_id(); | 1117 webview_info.embedder_extension_id = embedder_extension_id(); |
| 1118 | 1118 |
| 1119 content::BrowserThread::PostTask( | 1119 content::BrowserThread::PostTask( |
| 1120 content::BrowserThread::IO, FROM_HERE, | 1120 content::BrowserThread::IO, |
| 1121 base::Bind( | 1121 FROM_HERE, |
| 1122 &ExtensionRendererState::AddWebView, | 1122 base::Bind(&ExtensionRendererState::AddWebView, |
| 1123 base::Unretained(ExtensionRendererState::GetInstance()), | 1123 base::Unretained(ExtensionRendererState::GetInstance()), |
| 1124 guest_web_contents()->GetRenderProcessHost()->GetID(), | 1124 guest_web_contents()->GetRenderProcessHost()->GetID(), |
| 1125 guest_web_contents()->GetRoutingID(), | 1125 guest_web_contents()->GetRoutingID(), |
| 1126 webview_info)); | 1126 partition_id, |
|
Fady Samuel
2014/06/16 22:02:32
This extra parameter is unnecessary. You can grab
Xi Han
2014/06/17 13:42:30
Done.
| |
| 1127 webview_info)); | |
| 1127 } | 1128 } |
| 1128 | 1129 |
| 1129 // static | 1130 // static |
| 1130 void WebViewGuest::RemoveWebViewFromExtensionRendererState( | 1131 void WebViewGuest::RemoveWebViewFromExtensionRendererState( |
| 1131 WebContents* web_contents) { | 1132 WebContents* web_contents) { |
| 1132 content::BrowserThread::PostTask( | 1133 content::BrowserThread::PostTask( |
| 1133 content::BrowserThread::IO, FROM_HERE, | 1134 content::BrowserThread::IO, FROM_HERE, |
| 1134 base::Bind( | 1135 base::Bind( |
| 1135 &ExtensionRendererState::RemoveWebView, | 1136 &ExtensionRendererState::RemoveWebView, |
| 1136 base::Unretained(ExtensionRendererState::GetInstance()), | 1137 base::Unretained(ExtensionRendererState::GetInstance()), |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1591 bool allow, | 1592 bool allow, |
| 1592 const std::string& user_input) { | 1593 const std::string& user_input) { |
| 1593 WebViewGuest* guest = | 1594 WebViewGuest* guest = |
| 1594 WebViewGuest::From(embedder_render_process_id(), new_window_instance_id); | 1595 WebViewGuest::From(embedder_render_process_id(), new_window_instance_id); |
| 1595 if (!guest) | 1596 if (!guest) |
| 1596 return; | 1597 return; |
| 1597 | 1598 |
| 1598 if (!allow) | 1599 if (!allow) |
| 1599 guest->Destroy(); | 1600 guest->Destroy(); |
| 1600 } | 1601 } |
| OLD | NEW |