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" |
11 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 11 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
12 #include "chrome/browser/extensions/api/web_request/web_request_api.h" | 12 #include "chrome/browser/extensions/api/web_request/web_request_api.h" |
13 #include "chrome/browser/extensions/api/web_view/web_view_internal_api.h" | 13 #include "chrome/browser/extensions/api/web_view/web_view_internal_api.h" |
14 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" | 14 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" |
15 #include "chrome/browser/extensions/extension_renderer_state.h" | 15 #include "chrome/browser/extensions/extension_renderer_state.h" |
16 #include "chrome/browser/extensions/menu_manager.h" | 16 #include "chrome/browser/extensions/menu_manager.h" |
17 #include "chrome/browser/extensions/script_executor.h" | 17 #include "chrome/browser/extensions/script_executor.h" |
18 #include "chrome/browser/favicon/favicon_tab_helper.h" | 18 #include "chrome/browser/favicon/favicon_tab_helper.h" |
19 #include "chrome/browser/geolocation/geolocation_permission_context.h" | 19 #include "chrome/browser/geolocation/geolocation_permission_context.h" |
20 #include "chrome/browser/geolocation/geolocation_permission_context_factory.h" | 20 #include "chrome/browser/geolocation/geolocation_permission_context_factory.h" |
21 #include "chrome/browser/guest_view/guest_view_constants.h" | 21 #include "chrome/browser/guest_view/guest_view_constants.h" |
22 #include "chrome/browser/guest_view/guest_view_manager.h" | 22 #include "chrome/browser/guest_view/guest_view_manager.h" |
23 #include "chrome/browser/guest_view/web_view/web_view_constants.h" | 23 #include "chrome/browser/guest_view/web_view/web_view_constants.h" |
24 #include "chrome/browser/guest_view/web_view/web_view_permission_types.h" | 24 #include "chrome/browser/guest_view/web_view/web_view_permission_types.h" |
25 #include "chrome/browser/renderer_context_menu/context_menu_delegate.h" | 25 #include "chrome/browser/renderer_context_menu/context_menu_delegate.h" |
26 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" | 26 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" |
27 #include "chrome/browser/ui/pdf/pdf_tab_helper.h" | 27 #include "chrome/browser/ui/pdf/pdf_tab_helper.h" |
28 #include "chrome/common/chrome_version_info.h" | 28 #include "chrome/common/chrome_version_info.h" |
| 29 #include "chrome/common/extensions/chrome_extension_messages.h" |
29 #include "chrome/common/render_messages.h" | 30 #include "chrome/common/render_messages.h" |
30 #include "content/public/browser/browser_thread.h" | 31 #include "content/public/browser/browser_thread.h" |
31 #include "content/public/browser/child_process_security_policy.h" | 32 #include "content/public/browser/child_process_security_policy.h" |
32 #include "content/public/browser/host_zoom_map.h" | 33 #include "content/public/browser/host_zoom_map.h" |
33 #include "content/public/browser/native_web_keyboard_event.h" | 34 #include "content/public/browser/native_web_keyboard_event.h" |
34 #include "content/public/browser/navigation_entry.h" | 35 #include "content/public/browser/navigation_entry.h" |
35 #include "content/public/browser/notification_details.h" | 36 #include "content/public/browser/notification_details.h" |
36 #include "content/public/browser/notification_service.h" | 37 #include "content/public/browser/notification_service.h" |
37 #include "content/public/browser/notification_source.h" | 38 #include "content/public/browser/notification_source.h" |
38 #include "content/public/browser/notification_types.h" | 39 #include "content/public/browser/notification_types.h" |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 } else { | 208 } else { |
208 *storage_partition_id = partition_str; | 209 *storage_partition_id = partition_str; |
209 *persist_storage = false; | 210 *persist_storage = false; |
210 } | 211 } |
211 } | 212 } |
212 | 213 |
213 } // namespace | 214 } // namespace |
214 | 215 |
215 WebViewGuest::WebViewGuest(content::BrowserContext* browser_context, | 216 WebViewGuest::WebViewGuest(content::BrowserContext* browser_context, |
216 int guest_instance_id) | 217 int guest_instance_id) |
217 : GuestView<WebViewGuest>(browser_context, guest_instance_id), | 218 : GuestView<WebViewGuest>(browser_context, guest_instance_id), |
218 pending_context_menu_request_id_(0), | 219 pending_context_menu_request_id_(0), |
219 next_permission_request_id_(0), | 220 next_permission_request_id_(0), |
220 is_overriding_user_agent_(false), | 221 is_overriding_user_agent_(false), |
221 main_frame_id_(0), | 222 main_frame_id_(0), |
222 chromevox_injected_(false), | 223 chromevox_injected_(false), |
223 find_helper_(this), | 224 find_helper_(this), |
224 javascript_dialog_helper_(this) { | 225 javascript_dialog_helper_(this) { |
225 } | 226 } |
226 | 227 |
227 // static | 228 // static |
(...skipping 1427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1655 bool allow, | 1656 bool allow, |
1656 const std::string& user_input) { | 1657 const std::string& user_input) { |
1657 WebViewGuest* guest = | 1658 WebViewGuest* guest = |
1658 WebViewGuest::From(embedder_render_process_id(), new_window_instance_id); | 1659 WebViewGuest::From(embedder_render_process_id(), new_window_instance_id); |
1659 if (!guest) | 1660 if (!guest) |
1660 return; | 1661 return; |
1661 | 1662 |
1662 if (!allow) | 1663 if (!allow) |
1663 guest->Destroy(); | 1664 guest->Destroy(); |
1664 } | 1665 } |
OLD | NEW |