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

Unified Diff: chrome/browser/guest_view/app_view/app_view_guest.cc

Issue 378873002: Move permission check from GuestViewInternal to derived GuestView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@app_view_meat
Patch Set: Diff against tip of tree Created 6 years, 5 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
« no previous file with comments | « chrome/browser/guest_view/app_view/app_view_guest.h ('k') | chrome/browser/guest_view/guest_view_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/guest_view/app_view/app_view_guest.cc
diff --git a/chrome/browser/guest_view/app_view/app_view_guest.cc b/chrome/browser/guest_view/app_view/app_view_guest.cc
index 457c58baac53b34a9fd520dd24fcae43d067c3d7..30942a34d1e4691c5d32ed532f159dbc27093bcf 100644
--- a/chrome/browser/guest_view/app_view/app_view_guest.cc
+++ b/chrome/browser/guest_view/app_view/app_view_guest.cc
@@ -21,6 +21,7 @@
#include "extensions/browser/view_type_utils.h"
#include "extensions/common/api/app_runtime.h"
#include "extensions/common/extension_messages.h"
+#include "extensions/common/permissions/permissions_data.h"
#include "ipc/ipc_message_macros.h"
namespace app_runtime = extensions::core_api::app_runtime;
@@ -124,6 +125,19 @@ bool AppViewGuest::HandleContextMenu(const content::ContextMenuParams& params) {
return true;
}
+bool AppViewGuest::CanEmbedderUseGuestView(
+ const std::string& embedder_extension_id) {
+ Profile* profile = Profile::FromBrowserContext(browser_context());
+ ExtensionService* service =
+ extensions::ExtensionSystem::Get(profile)->extension_service();
+ const extensions::Extension* embedder_extension =
+ service->GetExtensionById(embedder_extension_id, false);
+ const extensions::PermissionsData* permissions_data =
+ embedder_extension->permissions_data();
+ return permissions_data->HasAPIPermission(
+ extensions::APIPermission::kAppView);
+}
+
void AppViewGuest::CreateWebContents(
const std::string& embedder_extension_id,
int embedder_render_process_id,
« no previous file with comments | « chrome/browser/guest_view/app_view/app_view_guest.h ('k') | chrome/browser/guest_view/guest_view_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698