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 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1077 | 1077 |
1078 // Navigate to the data URL. | 1078 // Navigate to the data URL. |
1079 web_contents()->GetController().LoadURLWithParams(load_params); | 1079 web_contents()->GetController().LoadURLWithParams(load_params); |
1080 | 1080 |
1081 return true; | 1081 return true; |
1082 } | 1082 } |
1083 | 1083 |
1084 void WebViewGuest::AddNewContents(content::WebContents* source, | 1084 void WebViewGuest::AddNewContents(content::WebContents* source, |
1085 content::WebContents* new_contents, | 1085 content::WebContents* new_contents, |
1086 WindowOpenDisposition disposition, | 1086 WindowOpenDisposition disposition, |
1087 const gfx::Rect& initial_pos, | 1087 const gfx::Rect& initial_rect, |
1088 bool user_gesture, | 1088 bool user_gesture, |
1089 bool* was_blocked) { | 1089 bool* was_blocked) { |
1090 if (was_blocked) | 1090 if (was_blocked) |
1091 *was_blocked = false; | 1091 *was_blocked = false; |
1092 RequestNewWindowPermission(disposition, | 1092 RequestNewWindowPermission(disposition, |
1093 initial_pos, | 1093 initial_rect, |
1094 user_gesture, | 1094 user_gesture, |
1095 new_contents); | 1095 new_contents); |
1096 } | 1096 } |
1097 | 1097 |
1098 content::WebContents* WebViewGuest::OpenURLFromTab( | 1098 content::WebContents* WebViewGuest::OpenURLFromTab( |
1099 content::WebContents* source, | 1099 content::WebContents* source, |
1100 const content::OpenURLParams& params) { | 1100 const content::OpenURLParams& params) { |
1101 // If the guest wishes to navigate away prior to attachment then we save the | 1101 // If the guest wishes to navigate away prior to attachment then we save the |
1102 // navigation to perform upon attachment. Navigation initializes a lot of | 1102 // navigation to perform upon attachment. Navigation initializes a lot of |
1103 // state that assumes an embedder exists, such as RenderWidgetHostViewGuest. | 1103 // state that assumes an embedder exists, such as RenderWidgetHostViewGuest. |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1213 WebViewGuest::From(owner_web_contents()->GetRenderProcessHost()->GetID(), | 1213 WebViewGuest::From(owner_web_contents()->GetRenderProcessHost()->GetID(), |
1214 new_window_instance_id); | 1214 new_window_instance_id); |
1215 if (!guest) | 1215 if (!guest) |
1216 return; | 1216 return; |
1217 | 1217 |
1218 if (!allow) | 1218 if (!allow) |
1219 guest->Destroy(); | 1219 guest->Destroy(); |
1220 } | 1220 } |
1221 | 1221 |
1222 } // namespace extensions | 1222 } // namespace extensions |
OLD | NEW |