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 "extensions/browser/guest_view/web_view/web_view_guest.h" | 5 #include "extensions/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 "content/public/browser/browser_context.h" | 10 #include "content/public/browser/browser_context.h" |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 // lifetime of the new guest is no longer managed by the opener guest. | 294 // lifetime of the new guest is no longer managed by the opener guest. |
295 GetOpener()->pending_new_windows_.erase(this); | 295 GetOpener()->pending_new_windows_.erase(this); |
296 } | 296 } |
297 | 297 |
298 bool allow_transparency = false; | 298 bool allow_transparency = false; |
299 attach_params()->GetBoolean(webview::kAttributeAllowTransparency, | 299 attach_params()->GetBoolean(webview::kAttributeAllowTransparency, |
300 &allow_transparency); | 300 &allow_transparency); |
301 // We need to set the background opaque flag after navigation to ensure that | 301 // We need to set the background opaque flag after navigation to ensure that |
302 // there is a RenderWidgetHostView available. | 302 // there is a RenderWidgetHostView available. |
303 SetAllowTransparency(allow_transparency); | 303 SetAllowTransparency(allow_transparency); |
| 304 |
| 305 if (web_view_guest_delegate_) |
| 306 web_view_guest_delegate_->OnDidAttachToEmbedder(); |
304 } | 307 } |
305 | 308 |
306 void WebViewGuest::DidInitialize() { | 309 void WebViewGuest::DidInitialize() { |
307 script_executor_.reset( | 310 script_executor_.reset( |
308 new ScriptExecutor(web_contents(), &script_observers_)); | 311 new ScriptExecutor(web_contents(), &script_observers_)); |
309 | 312 |
310 notification_registrar_.Add(this, | 313 notification_registrar_.Add(this, |
311 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, | 314 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, |
312 content::Source<WebContents>(web_contents())); | 315 content::Source<WebContents>(web_contents())); |
313 | 316 |
(...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1137 WebViewGuest* guest = | 1140 WebViewGuest* guest = |
1138 WebViewGuest::From(embedder_render_process_id(), new_window_instance_id); | 1141 WebViewGuest::From(embedder_render_process_id(), new_window_instance_id); |
1139 if (!guest) | 1142 if (!guest) |
1140 return; | 1143 return; |
1141 | 1144 |
1142 if (!allow) | 1145 if (!allow) |
1143 guest->Destroy(); | 1146 guest->Destroy(); |
1144 } | 1147 } |
1145 | 1148 |
1146 } // namespace extensions | 1149 } // namespace extensions |
OLD | NEW |