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 15 matching lines...) Expand all Loading... |
26 #include "content/public/browser/browser_thread.h" | 26 #include "content/public/browser/browser_thread.h" |
27 #include "content/public/browser/child_process_security_policy.h" | 27 #include "content/public/browser/child_process_security_policy.h" |
28 #include "content/public/browser/geolocation_permission_context.h" | 28 #include "content/public/browser/geolocation_permission_context.h" |
29 #include "content/public/browser/native_web_keyboard_event.h" | 29 #include "content/public/browser/native_web_keyboard_event.h" |
30 #include "content/public/browser/navigation_entry.h" | 30 #include "content/public/browser/navigation_entry.h" |
31 #include "content/public/browser/notification_details.h" | 31 #include "content/public/browser/notification_details.h" |
32 #include "content/public/browser/notification_service.h" | 32 #include "content/public/browser/notification_service.h" |
33 #include "content/public/browser/notification_source.h" | 33 #include "content/public/browser/notification_source.h" |
34 #include "content/public/browser/notification_types.h" | 34 #include "content/public/browser/notification_types.h" |
35 #include "content/public/browser/render_process_host.h" | 35 #include "content/public/browser/render_process_host.h" |
| 36 #include "content/public/browser/render_view_host.h" |
36 #include "content/public/browser/resource_request_details.h" | 37 #include "content/public/browser/resource_request_details.h" |
37 #include "content/public/browser/site_instance.h" | 38 #include "content/public/browser/site_instance.h" |
38 #include "content/public/browser/storage_partition.h" | 39 #include "content/public/browser/storage_partition.h" |
39 #include "content/public/browser/user_metrics.h" | 40 #include "content/public/browser/user_metrics.h" |
40 #include "content/public/browser/web_contents.h" | 41 #include "content/public/browser/web_contents.h" |
41 #include "content/public/browser/web_contents_delegate.h" | 42 #include "content/public/browser/web_contents_delegate.h" |
42 #include "content/public/common/media_stream_request.h" | 43 #include "content/public/common/media_stream_request.h" |
43 #include "content/public/common/page_zoom.h" | 44 #include "content/public/common/page_zoom.h" |
44 #include "content/public/common/result_codes.h" | 45 #include "content/public/common/result_codes.h" |
45 #include "content/public/common/stop_find_action.h" | 46 #include "content/public/common/stop_find_action.h" |
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
895 if (!attached()) { | 896 if (!attached()) { |
896 // We cannot reload now because all resource loads are suspended until | 897 // We cannot reload now because all resource loads are suspended until |
897 // attachment. | 898 // attachment. |
898 pending_reload_on_attachment_ = true; | 899 pending_reload_on_attachment_ = true; |
899 return; | 900 return; |
900 } | 901 } |
901 guest_web_contents()->GetController().Reload(false); | 902 guest_web_contents()->GetController().Reload(false); |
902 } | 903 } |
903 | 904 |
904 void WebViewGuest::RenderViewReady() { | 905 void WebViewGuest::RenderViewReady() { |
| 906 // The guest RenderView should always live in an isolated guest process. |
| 907 CHECK(guest_web_contents()->GetRenderProcessHost()->IsIsolatedGuest()); |
905 Send(new ChromeViewMsg_SetName(guest_web_contents()->GetRoutingID(), name_)); | 908 Send(new ChromeViewMsg_SetName(guest_web_contents()->GetRoutingID(), name_)); |
906 } | 909 } |
907 | 910 |
908 void WebViewGuest::ReportFrameNameChange(const std::string& name) { | 911 void WebViewGuest::ReportFrameNameChange(const std::string& name) { |
909 name_ = name; | 912 name_ = name; |
910 scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue()); | 913 scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue()); |
911 args->SetString(webview::kName, name); | 914 args->SetString(webview::kName, name); |
912 DispatchEvent( | 915 DispatchEvent( |
913 new GuestViewBase::Event(webview::kEventFrameNameChanged, args.Pass())); | 916 new GuestViewBase::Event(webview::kEventFrameNameChanged, args.Pass())); |
914 } | 917 } |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1409 bool allow, | 1412 bool allow, |
1410 const std::string& user_input) { | 1413 const std::string& user_input) { |
1411 WebViewGuest* guest = | 1414 WebViewGuest* guest = |
1412 WebViewGuest::From(embedder_render_process_id(), new_window_instance_id); | 1415 WebViewGuest::From(embedder_render_process_id(), new_window_instance_id); |
1413 if (!guest) | 1416 if (!guest) |
1414 return; | 1417 return; |
1415 | 1418 |
1416 if (!allow) | 1419 if (!allow) |
1417 guest->Destroy(); | 1420 guest->Destroy(); |
1418 } | 1421 } |
OLD | NEW |