| 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 "components/browsing_data/storage_partition_http_cache_data_remover.h" | 10 #include "components/browsing_data/storage_partition_http_cache_data_remover.h" |
| 11 #include "components/guest_view/browser/guest_view_event.h" |
| 12 #include "components/guest_view/browser/guest_view_manager.h" |
| 13 #include "components/guest_view/common/guest_view_constants.h" |
| 11 #include "components/web_cache/browser/web_cache_manager.h" | 14 #include "components/web_cache/browser/web_cache_manager.h" |
| 12 #include "content/public/browser/browser_context.h" | 15 #include "content/public/browser/browser_context.h" |
| 13 #include "content/public/browser/browser_thread.h" | 16 #include "content/public/browser/browser_thread.h" |
| 14 #include "content/public/browser/child_process_security_policy.h" | 17 #include "content/public/browser/child_process_security_policy.h" |
| 15 #include "content/public/browser/native_web_keyboard_event.h" | 18 #include "content/public/browser/native_web_keyboard_event.h" |
| 16 #include "content/public/browser/navigation_entry.h" | 19 #include "content/public/browser/navigation_entry.h" |
| 17 #include "content/public/browser/notification_details.h" | 20 #include "content/public/browser/notification_details.h" |
| 18 #include "content/public/browser/notification_service.h" | 21 #include "content/public/browser/notification_service.h" |
| 19 #include "content/public/browser/notification_source.h" | 22 #include "content/public/browser/notification_source.h" |
| 20 #include "content/public/browser/notification_types.h" | 23 #include "content/public/browser/notification_types.h" |
| 21 #include "content/public/browser/render_process_host.h" | 24 #include "content/public/browser/render_process_host.h" |
| 22 #include "content/public/browser/render_view_host.h" | 25 #include "content/public/browser/render_view_host.h" |
| 23 #include "content/public/browser/render_widget_host_view.h" | 26 #include "content/public/browser/render_widget_host_view.h" |
| 24 #include "content/public/browser/resource_request_details.h" | 27 #include "content/public/browser/resource_request_details.h" |
| 25 #include "content/public/browser/site_instance.h" | 28 #include "content/public/browser/site_instance.h" |
| 26 #include "content/public/browser/storage_partition.h" | 29 #include "content/public/browser/storage_partition.h" |
| 27 #include "content/public/browser/user_metrics.h" | 30 #include "content/public/browser/user_metrics.h" |
| 28 #include "content/public/browser/web_contents.h" | 31 #include "content/public/browser/web_contents.h" |
| 29 #include "content/public/browser/web_contents_delegate.h" | 32 #include "content/public/browser/web_contents_delegate.h" |
| 30 #include "content/public/common/media_stream_request.h" | 33 #include "content/public/common/media_stream_request.h" |
| 31 #include "content/public/common/page_zoom.h" | 34 #include "content/public/common/page_zoom.h" |
| 32 #include "content/public/common/result_codes.h" | 35 #include "content/public/common/result_codes.h" |
| 33 #include "content/public/common/stop_find_action.h" | 36 #include "content/public/common/stop_find_action.h" |
| 34 #include "content/public/common/url_constants.h" | 37 #include "content/public/common/url_constants.h" |
| 35 #include "extensions/browser/api/declarative/rules_registry_service.h" | 38 #include "extensions/browser/api/declarative/rules_registry_service.h" |
| 36 #include "extensions/browser/api/extensions_api_client.h" | 39 #include "extensions/browser/api/extensions_api_client.h" |
| 37 #include "extensions/browser/api/guest_view/web_view/web_view_internal_api.h" | 40 #include "extensions/browser/api/guest_view/web_view/web_view_internal_api.h" |
| 38 #include "extensions/browser/api/web_request/web_request_api.h" | 41 #include "extensions/browser/api/web_request/web_request_api.h" |
| 39 #include "extensions/browser/extension_system.h" | 42 #include "extensions/browser/extension_system.h" |
| 40 #include "extensions/browser/guest_view/guest_view_event.h" | |
| 41 #include "extensions/browser/guest_view/guest_view_manager.h" | |
| 42 #include "extensions/browser/guest_view/web_view/web_view_constants.h" | 43 #include "extensions/browser/guest_view/web_view/web_view_constants.h" |
| 43 #include "extensions/browser/guest_view/web_view/web_view_content_script_manager
.h" | 44 #include "extensions/browser/guest_view/web_view/web_view_content_script_manager
.h" |
| 44 #include "extensions/browser/guest_view/web_view/web_view_permission_helper.h" | 45 #include "extensions/browser/guest_view/web_view/web_view_permission_helper.h" |
| 45 #include "extensions/browser/guest_view/web_view/web_view_permission_types.h" | 46 #include "extensions/browser/guest_view/web_view/web_view_permission_types.h" |
| 46 #include "extensions/browser/guest_view/web_view/web_view_renderer_state.h" | 47 #include "extensions/browser/guest_view/web_view/web_view_renderer_state.h" |
| 47 #include "extensions/common/constants.h" | 48 #include "extensions/common/constants.h" |
| 48 #include "extensions/common/extension_messages.h" | 49 #include "extensions/common/extension_messages.h" |
| 49 #include "extensions/common/guest_view/guest_view_constants.h" | |
| 50 #include "extensions/strings/grit/extensions_strings.h" | 50 #include "extensions/strings/grit/extensions_strings.h" |
| 51 #include "ipc/ipc_message_macros.h" | 51 #include "ipc/ipc_message_macros.h" |
| 52 #include "net/base/escape.h" | 52 #include "net/base/escape.h" |
| 53 #include "net/base/net_errors.h" | 53 #include "net/base/net_errors.h" |
| 54 #include "ui/base/models/simple_menu_model.h" | 54 #include "ui/base/models/simple_menu_model.h" |
| 55 #include "url/url_constants.h" | 55 #include "url/url_constants.h" |
| 56 | 56 |
| 57 using base::UserMetricsAction; | 57 using base::UserMetricsAction; |
| 58 using content::RenderFrameHost; | 58 using content::RenderFrameHost; |
| 59 using content::ResourceType; | 59 using content::ResourceType; |
| 60 using content::StoragePartition; | 60 using content::StoragePartition; |
| 61 using content::WebContents; | 61 using content::WebContents; |
| 62 using guestview::GuestViewBase; |
| 63 using guestview::GuestViewEvent; |
| 64 using guestview::GuestViewManager; |
| 62 using ui_zoom::ZoomController; | 65 using ui_zoom::ZoomController; |
| 63 | 66 |
| 64 namespace extensions { | 67 namespace extensions { |
| 65 | 68 |
| 66 namespace { | 69 namespace { |
| 67 | 70 |
| 68 // Returns storage partition removal mask from web_view clearData mask. Note | 71 // Returns storage partition removal mask from web_view clearData mask. Note |
| 69 // that storage partition mask is a subset of webview's data removal mask. | 72 // that storage partition mask is a subset of webview's data removal mask. |
| 70 uint32 GetStoragePartitionRemovalMask(uint32 web_view_removal_mask) { | 73 uint32 GetStoragePartitionRemovalMask(uint32 web_view_removal_mask) { |
| 71 uint32 mask = 0; | 74 uint32 mask = 0; |
| (...skipping 1353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1425 scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue()); | 1428 scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue()); |
| 1426 DispatchEventToView( | 1429 DispatchEventToView( |
| 1427 new GuestViewEvent(webview::kEventExitFullscreen, args.Pass())); | 1430 new GuestViewEvent(webview::kEventExitFullscreen, args.Pass())); |
| 1428 } | 1431 } |
| 1429 // Since we changed fullscreen state, sending a Resize message ensures that | 1432 // Since we changed fullscreen state, sending a Resize message ensures that |
| 1430 // renderer/ sees the change. | 1433 // renderer/ sees the change. |
| 1431 web_contents()->GetRenderViewHost()->WasResized(); | 1434 web_contents()->GetRenderViewHost()->WasResized(); |
| 1432 } | 1435 } |
| 1433 | 1436 |
| 1434 } // namespace extensions | 1437 } // namespace extensions |
| OLD | NEW |