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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 new ScriptExecutor(web_contents(), &script_observers_)); | 394 new ScriptExecutor(web_contents(), &script_observers_)); |
395 | 395 |
396 notification_registrar_.Add(this, | 396 notification_registrar_.Add(this, |
397 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, | 397 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, |
398 content::Source<WebContents>(web_contents())); | 398 content::Source<WebContents>(web_contents())); |
399 | 399 |
400 notification_registrar_.Add(this, | 400 notification_registrar_.Add(this, |
401 content::NOTIFICATION_RESOURCE_RECEIVED_REDIRECT, | 401 content::NOTIFICATION_RESOURCE_RECEIVED_REDIRECT, |
402 content::Source<WebContents>(web_contents())); | 402 content::Source<WebContents>(web_contents())); |
403 | 403 |
404 if (web_view_guest_delegate_) | |
405 web_view_guest_delegate_->OnDidInitialize(); | |
406 ExtensionsAPIClient::Get()->AttachWebContentsHelpers(web_contents()); | 404 ExtensionsAPIClient::Get()->AttachWebContentsHelpers(web_contents()); |
407 web_view_permission_helper_.reset(new WebViewPermissionHelper(this)); | 405 web_view_permission_helper_.reset(new WebViewPermissionHelper(this)); |
408 | 406 |
409 rules_registry_id_ = GetOrGenerateRulesRegistryID( | 407 rules_registry_id_ = GetOrGenerateRulesRegistryID( |
410 owner_web_contents()->GetRenderProcessHost()->GetID(), | 408 owner_web_contents()->GetRenderProcessHost()->GetID(), |
411 view_instance_id()); | 409 view_instance_id()); |
412 | 410 |
413 // We must install the mapping from guests to WebViews prior to resuming | 411 // We must install the mapping from guests to WebViews prior to resuming |
414 // suspended resource loads so that the WebRequest API will catch resource | 412 // suspended resource loads so that the WebRequest API will catch resource |
415 // requests. | 413 // requests. |
(...skipping 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1526 std::unique_ptr<base::DictionaryValue> args(new base::DictionaryValue()); | 1524 std::unique_ptr<base::DictionaryValue> args(new base::DictionaryValue()); |
1527 DispatchEventToView(base::MakeUnique<GuestViewEvent>( | 1525 DispatchEventToView(base::MakeUnique<GuestViewEvent>( |
1528 webview::kEventExitFullscreen, std::move(args))); | 1526 webview::kEventExitFullscreen, std::move(args))); |
1529 } | 1527 } |
1530 // Since we changed fullscreen state, sending a Resize message ensures that | 1528 // Since we changed fullscreen state, sending a Resize message ensures that |
1531 // renderer/ sees the change. | 1529 // renderer/ sees the change. |
1532 web_contents()->GetRenderViewHost()->GetWidget()->WasResized(); | 1530 web_contents()->GetRenderViewHost()->GetWidget()->WasResized(); |
1533 } | 1531 } |
1534 | 1532 |
1535 } // namespace extensions | 1533 } // namespace extensions |
OLD | NEW |