OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/renderer/chrome_content_renderer_client.h" | 5 #include "chrome/renderer/chrome_content_renderer_client.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/debug/crash_logging.h" | 8 #include "base/debug/crash_logging.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "chrome/common/localized_error.h" | 25 #include "chrome/common/localized_error.h" |
26 #include "chrome/common/pepper_permission_util.h" | 26 #include "chrome/common/pepper_permission_util.h" |
27 #include "chrome/common/render_messages.h" | 27 #include "chrome/common/render_messages.h" |
28 #include "chrome/common/url_constants.h" | 28 #include "chrome/common/url_constants.h" |
29 #include "chrome/renderer/benchmarking_extension.h" | 29 #include "chrome/renderer/benchmarking_extension.h" |
30 #include "chrome/renderer/chrome_render_frame_observer.h" | 30 #include "chrome/renderer/chrome_render_frame_observer.h" |
31 #include "chrome/renderer/chrome_render_process_observer.h" | 31 #include "chrome/renderer/chrome_render_process_observer.h" |
32 #include "chrome/renderer/chrome_render_view_observer.h" | 32 #include "chrome/renderer/chrome_render_view_observer.h" |
33 #include "chrome/renderer/content_settings_observer.h" | 33 #include "chrome/renderer/content_settings_observer.h" |
34 #include "chrome/renderer/extensions/chrome_extensions_renderer_client.h" | 34 #include "chrome/renderer/extensions/chrome_extensions_renderer_client.h" |
35 #include "chrome/renderer/extensions/chrome_v8_context.h" | |
36 #include "chrome/renderer/extensions/chrome_v8_extension.h" | |
37 #include "chrome/renderer/extensions/dispatcher.h" | 35 #include "chrome/renderer/extensions/dispatcher.h" |
38 #include "chrome/renderer/extensions/extension_frame_helper.h" | 36 #include "chrome/renderer/extensions/extension_frame_helper.h" |
39 #include "chrome/renderer/extensions/extension_helper.h" | 37 #include "chrome/renderer/extensions/extension_helper.h" |
40 #include "chrome/renderer/extensions/renderer_permissions_policy_delegate.h" | 38 #include "chrome/renderer/extensions/renderer_permissions_policy_delegate.h" |
41 #include "chrome/renderer/extensions/resource_request_policy.h" | 39 #include "chrome/renderer/extensions/resource_request_policy.h" |
42 #include "chrome/renderer/external_extension.h" | 40 #include "chrome/renderer/external_extension.h" |
43 #include "chrome/renderer/loadtimes_extension_bindings.h" | 41 #include "chrome/renderer/loadtimes_extension_bindings.h" |
44 #include "chrome/renderer/media/cast_ipc_dispatcher.h" | 42 #include "chrome/renderer/media/cast_ipc_dispatcher.h" |
45 #include "chrome/renderer/media/chrome_key_systems.h" | 43 #include "chrome/renderer/media/chrome_key_systems.h" |
46 #include "chrome/renderer/net/net_error_helper.h" | 44 #include "chrome/renderer/net/net_error_helper.h" |
(...skipping 29 matching lines...) Expand all Loading... |
76 #include "content/public/common/content_constants.h" | 74 #include "content/public/common/content_constants.h" |
77 #include "content/public/renderer/render_frame.h" | 75 #include "content/public/renderer/render_frame.h" |
78 #include "content/public/renderer/render_thread.h" | 76 #include "content/public/renderer/render_thread.h" |
79 #include "content/public/renderer/render_view.h" | 77 #include "content/public/renderer/render_view.h" |
80 #include "content/public/renderer/render_view_visitor.h" | 78 #include "content/public/renderer/render_view_visitor.h" |
81 #include "extensions/common/constants.h" | 79 #include "extensions/common/constants.h" |
82 #include "extensions/common/extension.h" | 80 #include "extensions/common/extension.h" |
83 #include "extensions/common/extension_set.h" | 81 #include "extensions/common/extension_set.h" |
84 #include "extensions/common/extension_urls.h" | 82 #include "extensions/common/extension_urls.h" |
85 #include "extensions/common/switches.h" | 83 #include "extensions/common/switches.h" |
| 84 #include "extensions/renderer/script_context.h" |
86 #include "grit/generated_resources.h" | 85 #include "grit/generated_resources.h" |
87 #include "grit/locale_settings.h" | 86 #include "grit/locale_settings.h" |
88 #include "grit/renderer_resources.h" | 87 #include "grit/renderer_resources.h" |
89 #include "ipc/ipc_sync_channel.h" | 88 #include "ipc/ipc_sync_channel.h" |
90 #include "net/base/net_errors.h" | 89 #include "net/base/net_errors.h" |
91 #include "ppapi/c/private/ppb_nacl_private.h" | 90 #include "ppapi/c/private/ppb_nacl_private.h" |
92 #include "ppapi/c/private/ppb_pdf.h" | 91 #include "ppapi/c/private/ppb_pdf.h" |
93 #include "ppapi/shared_impl/ppapi_switches.h" | 92 #include "ppapi/shared_impl/ppapi_switches.h" |
94 #include "third_party/WebKit/public/platform/WebURL.h" | 93 #include "third_party/WebKit/public/platform/WebURL.h" |
95 #include "third_party/WebKit/public/platform/WebURLError.h" | 94 #include "third_party/WebKit/public/platform/WebURLError.h" |
(...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1060 if (!extension) | 1059 if (!extension) |
1061 *error_description = LocalizedError::GetErrorDetails(error, is_post); | 1060 *error_description = LocalizedError::GetErrorDetails(error, is_post); |
1062 } | 1061 } |
1063 } | 1062 } |
1064 | 1063 |
1065 bool ChromeContentRendererClient::RunIdleHandlerWhenWidgetsHidden() { | 1064 bool ChromeContentRendererClient::RunIdleHandlerWhenWidgetsHidden() { |
1066 return !extension_dispatcher_->is_extension_process(); | 1065 return !extension_dispatcher_->is_extension_process(); |
1067 } | 1066 } |
1068 | 1067 |
1069 bool ChromeContentRendererClient::AllowPopup() { | 1068 bool ChromeContentRendererClient::AllowPopup() { |
1070 extensions::ChromeV8Context* current_context = | 1069 extensions::ScriptContext* current_context = |
1071 extension_dispatcher_->v8_context_set().GetCurrent(); | 1070 extension_dispatcher_->script_context_set().GetCurrent(); |
1072 if (!current_context || !current_context->extension()) | 1071 if (!current_context || !current_context->extension()) |
1073 return false; | 1072 return false; |
1074 // See http://crbug.com/117446 for the subtlety of this check. | 1073 // See http://crbug.com/117446 for the subtlety of this check. |
1075 switch (current_context->context_type()) { | 1074 switch (current_context->context_type()) { |
1076 case extensions::Feature::UNSPECIFIED_CONTEXT: | 1075 case extensions::Feature::UNSPECIFIED_CONTEXT: |
1077 case extensions::Feature::WEB_PAGE_CONTEXT: | 1076 case extensions::Feature::WEB_PAGE_CONTEXT: |
1078 case extensions::Feature::UNBLESSED_EXTENSION_CONTEXT: | 1077 case extensions::Feature::UNBLESSED_EXTENSION_CONTEXT: |
1079 return false; | 1078 return false; |
1080 case extensions::Feature::BLESSED_EXTENSION_CONTEXT: | 1079 case extensions::Feature::BLESSED_EXTENSION_CONTEXT: |
1081 case extensions::Feature::CONTENT_SCRIPT_CONTEXT: | 1080 case extensions::Feature::CONTENT_SCRIPT_CONTEXT: |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1439 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 1438 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
1440 return !command_line->HasSwitch(extensions::switches::kExtensionProcess); | 1439 return !command_line->HasSwitch(extensions::switches::kExtensionProcess); |
1441 } | 1440 } |
1442 | 1441 |
1443 blink::WebWorkerPermissionClientProxy* | 1442 blink::WebWorkerPermissionClientProxy* |
1444 ChromeContentRendererClient::CreateWorkerPermissionClientProxy( | 1443 ChromeContentRendererClient::CreateWorkerPermissionClientProxy( |
1445 content::RenderFrame* render_frame, | 1444 content::RenderFrame* render_frame, |
1446 blink::WebFrame* frame) { | 1445 blink::WebFrame* frame) { |
1447 return new WorkerPermissionClientProxy(render_frame, frame); | 1446 return new WorkerPermissionClientProxy(render_frame, frame); |
1448 } | 1447 } |
OLD | NEW |