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" |
(...skipping 22 matching lines...) Expand all Loading... |
33 #include "content/public/common/media_stream_request.h" | 33 #include "content/public/common/media_stream_request.h" |
34 #include "content/public/common/page_zoom.h" | 34 #include "content/public/common/page_zoom.h" |
35 #include "content/public/common/result_codes.h" | 35 #include "content/public/common/result_codes.h" |
36 #include "content/public/common/stop_find_action.h" | 36 #include "content/public/common/stop_find_action.h" |
37 #include "content/public/common/url_constants.h" | 37 #include "content/public/common/url_constants.h" |
38 #include "extensions/browser/api/declarative/rules_registry_service.h" | 38 #include "extensions/browser/api/declarative/rules_registry_service.h" |
39 #include "extensions/browser/api/extensions_api_client.h" | 39 #include "extensions/browser/api/extensions_api_client.h" |
40 #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" |
41 #include "extensions/browser/api/web_request/web_request_api.h" | 41 #include "extensions/browser/api/web_request/web_request_api.h" |
42 #include "extensions/browser/extension_system.h" | 42 #include "extensions/browser/extension_system.h" |
| 43 #include "extensions/browser/extensions_browser_client.h" |
43 #include "extensions/browser/guest_view/web_view/web_view_constants.h" | 44 #include "extensions/browser/guest_view/web_view/web_view_constants.h" |
44 #include "extensions/browser/guest_view/web_view/web_view_content_script_manager
.h" | 45 #include "extensions/browser/guest_view/web_view/web_view_content_script_manager
.h" |
45 #include "extensions/browser/guest_view/web_view/web_view_permission_helper.h" | 46 #include "extensions/browser/guest_view/web_view/web_view_permission_helper.h" |
46 #include "extensions/browser/guest_view/web_view/web_view_permission_types.h" | 47 #include "extensions/browser/guest_view/web_view/web_view_permission_types.h" |
47 #include "extensions/browser/guest_view/web_view/web_view_renderer_state.h" | 48 #include "extensions/browser/guest_view/web_view/web_view_renderer_state.h" |
48 #include "extensions/common/constants.h" | 49 #include "extensions/common/constants.h" |
49 #include "extensions/common/extension_messages.h" | 50 #include "extensions/common/extension_messages.h" |
50 #include "extensions/strings/grit/extensions_strings.h" | 51 #include "extensions/strings/grit/extensions_strings.h" |
51 #include "ipc/ipc_message_macros.h" | 52 #include "ipc/ipc_message_macros.h" |
52 #include "net/base/escape.h" | 53 #include "net/base/escape.h" |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 FROM_HERE, | 227 FROM_HERE, |
227 base::Bind( | 228 base::Bind( |
228 &RemoveWebViewEventListenersOnIOThread, | 229 &RemoveWebViewEventListenersOnIOThread, |
229 browser_context, | 230 browser_context, |
230 embedder_process_id, | 231 embedder_process_id, |
231 view_instance_id)); | 232 view_instance_id)); |
232 | 233 |
233 // Clean up content scripts for the WebView. | 234 // Clean up content scripts for the WebView. |
234 auto csm = WebViewContentScriptManager::Get(browser_context); | 235 auto csm = WebViewContentScriptManager::Get(browser_context); |
235 csm->RemoveAllContentScriptsForWebView(embedder_process_id, view_instance_id); | 236 csm->RemoveAllContentScriptsForWebView(embedder_process_id, view_instance_id); |
| 237 |
| 238 // Allow an extensions browser client to potentially perform more cleanup. |
| 239 ExtensionsBrowserClient::Get()->CleanUpWebView(embedder_process_id, |
| 240 view_instance_id); |
236 } | 241 } |
237 | 242 |
238 // static | 243 // static |
239 GuestViewBase* WebViewGuest::Create(content::WebContents* owner_web_contents) { | 244 GuestViewBase* WebViewGuest::Create(content::WebContents* owner_web_contents) { |
240 return new WebViewGuest(owner_web_contents); | 245 return new WebViewGuest(owner_web_contents); |
241 } | 246 } |
242 | 247 |
243 // static | 248 // static |
244 bool WebViewGuest::GetGuestPartitionConfigForSite( | 249 bool WebViewGuest::GetGuestPartitionConfigForSite( |
245 const GURL& site, | 250 const GURL& site, |
(...skipping 1210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1456 scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue()); | 1461 scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue()); |
1457 DispatchEventToView( | 1462 DispatchEventToView( |
1458 new GuestViewEvent(webview::kEventExitFullscreen, args.Pass())); | 1463 new GuestViewEvent(webview::kEventExitFullscreen, args.Pass())); |
1459 } | 1464 } |
1460 // Since we changed fullscreen state, sending a Resize message ensures that | 1465 // Since we changed fullscreen state, sending a Resize message ensures that |
1461 // renderer/ sees the change. | 1466 // renderer/ sees the change. |
1462 web_contents()->GetRenderViewHost()->WasResized(); | 1467 web_contents()->GetRenderViewHost()->WasResized(); |
1463 } | 1468 } |
1464 | 1469 |
1465 } // namespace extensions | 1470 } // namespace extensions |
OLD | NEW |