Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(814)

Unified Diff: chrome/browser/extensions/api/webview/webview_api.cc

Issue 347113002: Refactor PluginPermissionHelper as WebViewPermissionHelper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests failures. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/webview/webview_api.cc
diff --git a/chrome/browser/extensions/api/webview/webview_api.cc b/chrome/browser/extensions/api/webview/webview_api.cc
index 1f1f626b0e0fd45d82327b9f016e90257c1f9b70..cfce5901c11efcf7ddcd385832c1a295e36d2141 100644
--- a/chrome/browser/extensions/api/webview/webview_api.cc
+++ b/chrome/browser/extensions/api/webview/webview_api.cc
@@ -9,6 +9,7 @@
#include "chrome/browser/extensions/api/context_menus/context_menus_api.h"
#include "chrome/browser/extensions/api/context_menus/context_menus_api_helpers.h"
#include "chrome/browser/extensions/tab_helper.h"
+#include "chrome/browser/guest_view/web_view/web_view_permission_helper.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/extensions/api/webview.h"
#include "content/public/browser/render_process_host.h"
@@ -503,13 +504,14 @@ bool WebviewSetPermissionFunction::RunAsyncSafe(WebViewGuest* guest) {
webview::SetPermission::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params.get());
- WebViewGuest::PermissionResponseAction action = WebViewGuest::DEFAULT;
+ WebViewPermissionHelper::PermissionResponseAction action =
+ WebViewPermissionHelper::DEFAULT;
switch (params->action) {
case Params::ACTION_ALLOW:
- action = WebViewGuest::ALLOW;
+ action = WebViewPermissionHelper::ALLOW;
break;
case Params::ACTION_DENY:
- action = WebViewGuest::DENY;
+ action = WebViewPermissionHelper::DENY;
break;
case Params::ACTION_DEFAULT:
break;
@@ -521,13 +523,14 @@ bool WebviewSetPermissionFunction::RunAsyncSafe(WebViewGuest* guest) {
if (params->user_input)
user_input = *params->user_input;
- WebViewGuest::SetPermissionResult result =
+ WebViewPermissionHelper::SetPermissionResult result =
guest->SetPermission(params->request_id, action, user_input);
- EXTENSION_FUNCTION_VALIDATE(result != WebViewGuest::SET_PERMISSION_INVALID);
+ EXTENSION_FUNCTION_VALIDATE(
+ result != WebViewPermissionHelper::SET_PERMISSION_INVALID);
SetResult(base::Value::CreateBooleanValue(
- result == WebViewGuest::SET_PERMISSION_ALLOWED));
+ result == WebViewPermissionHelper::SET_PERMISSION_ALLOWED));
SendResponse(true);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698