| 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/chrome_web_view_permission_helper_d
elegate.h" | 5 #include "chrome/browser/guest_view/web_view/chrome_web_view_permission_helper_d
elegate.h" |
| 6 | 6 |
| 7 #include "base/metrics/user_metrics.h" |
| 7 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 8 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 8 #include "chrome/browser/permissions/permission_manager.h" | 9 #include "chrome/browser/permissions/permission_manager.h" |
| 9 #include "chrome/browser/permissions/permission_request_id.h" | 10 #include "chrome/browser/permissions/permission_request_id.h" |
| 10 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" | 11 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" |
| 11 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/common/features.h" | 13 #include "chrome/common/features.h" |
| 13 #include "chrome/common/render_messages.h" | 14 #include "chrome/common/render_messages.h" |
| 14 #include "components/content_settings/core/common/content_settings_types.h" | 15 #include "components/content_settings/core/common/content_settings_types.h" |
| 15 #include "content/public/browser/render_frame_host.h" | 16 #include "content/public/browser/render_frame_host.h" |
| 16 #include "content/public/browser/render_process_host.h" | 17 #include "content/public/browser/render_process_host.h" |
| 17 #include "content/public/browser/render_view_host.h" | 18 #include "content/public/browser/render_view_host.h" |
| 18 #include "content/public/browser/user_metrics.h" | |
| 19 #include "extensions/browser/guest_view/web_view/web_view_constants.h" | 19 #include "extensions/browser/guest_view/web_view/web_view_constants.h" |
| 20 #include "extensions/browser/guest_view/web_view/web_view_guest.h" | 20 #include "extensions/browser/guest_view/web_view/web_view_guest.h" |
| 21 #include "ppapi/features/features.h" | 21 #include "ppapi/features/features.h" |
| 22 | 22 |
| 23 namespace extensions { | 23 namespace extensions { |
| 24 | 24 |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 void CallbackWrapper(const base::Callback<void(bool)>& callback, | 27 void CallbackWrapper(const base::Callback<void(bool)>& callback, |
| 28 ContentSetting status) { | 28 ContentSetting status) { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 base::DictionaryValue info; | 77 base::DictionaryValue info; |
| 78 info.SetString(std::string(kPluginName), name); | 78 info.SetString(std::string(kPluginName), name); |
| 79 info.SetString(std::string(kPluginIdentifier), identifier); | 79 info.SetString(std::string(kPluginIdentifier), identifier); |
| 80 web_view_permission_helper()->RequestPermission( | 80 web_view_permission_helper()->RequestPermission( |
| 81 WEB_VIEW_PERMISSION_TYPE_LOAD_PLUGIN, | 81 WEB_VIEW_PERMISSION_TYPE_LOAD_PLUGIN, |
| 82 info, | 82 info, |
| 83 base::Bind(&ChromeWebViewPermissionHelperDelegate::OnPermissionResponse, | 83 base::Bind(&ChromeWebViewPermissionHelperDelegate::OnPermissionResponse, |
| 84 weak_factory_.GetWeakPtr(), | 84 weak_factory_.GetWeakPtr(), |
| 85 identifier), | 85 identifier), |
| 86 true /* allowed_by_default */); | 86 true /* allowed_by_default */); |
| 87 content::RecordAction( | 87 base::RecordAction( |
| 88 base::UserMetricsAction("WebView.Guest.PluginLoadRequest")); | 88 base::UserMetricsAction("WebView.Guest.PluginLoadRequest")); |
| 89 } | 89 } |
| 90 | 90 |
| 91 void ChromeWebViewPermissionHelperDelegate::OnCouldNotLoadPlugin( | 91 void ChromeWebViewPermissionHelperDelegate::OnCouldNotLoadPlugin( |
| 92 const base::FilePath& plugin_path) { | 92 const base::FilePath& plugin_path) { |
| 93 } | 93 } |
| 94 | 94 |
| 95 void ChromeWebViewPermissionHelperDelegate::OnBlockedOutdatedPlugin( | 95 void ChromeWebViewPermissionHelperDelegate::OnBlockedOutdatedPlugin( |
| 96 int placeholder_id, | 96 int placeholder_id, |
| 97 const std::string& identifier) { | 97 const std::string& identifier) { |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 IPC::Message* reply_msg, | 326 IPC::Message* reply_msg, |
| 327 bool allowed) { | 327 bool allowed) { |
| 328 TabSpecificContentSettings::FileSystemAccessed( | 328 TabSpecificContentSettings::FileSystemAccessed( |
| 329 render_process_id, render_frame_id, url, !allowed); | 329 render_process_id, render_frame_id, url, !allowed); |
| 330 ChromeViewHostMsg_RequestFileSystemAccessSync::WriteReplyParams(reply_msg, | 330 ChromeViewHostMsg_RequestFileSystemAccessSync::WriteReplyParams(reply_msg, |
| 331 allowed); | 331 allowed); |
| 332 Send(reply_msg); | 332 Send(reply_msg); |
| 333 } | 333 } |
| 334 | 334 |
| 335 } // namespace extensions | 335 } // namespace extensions |
| OLD | NEW |