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

Unified Diff: extensions/components/javascript_dialog_extensions_client/javascript_dialog_extension_client_impl.cc

Issue 1658913002: Make extensions use a correct same-origin check. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Respond to comments. Created 4 years, 11 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: extensions/components/javascript_dialog_extensions_client/javascript_dialog_extension_client_impl.cc
diff --git a/extensions/components/javascript_dialog_extensions_client/javascript_dialog_extension_client_impl.cc b/extensions/components/javascript_dialog_extensions_client/javascript_dialog_extension_client_impl.cc
index 52f3e7e6b95a92e65f7f297f4f5507dcdef96c20..d2f5d50518ad955ee87d6ca7c520f2ce395e37df 100644
--- a/extensions/components/javascript_dialog_extensions_client/javascript_dialog_extension_client_impl.cc
+++ b/extensions/components/javascript_dialog_extensions_client/javascript_dialog_extension_client_impl.cc
@@ -11,6 +11,7 @@
#include "extensions/browser/process_manager.h"
#include "extensions/common/extension.h"
#include "ui/gfx/native_widget_types.h"
+#include "url/origin.h"
namespace javascript_dialog_extensions_client {
namespace {
@@ -62,8 +63,8 @@ class JavaScriptDialogExtensionsClientImpl
const GURL& origin_url,
std::string* name_out) override {
const Extension* extension = GetExtensionForWebContents(web_contents);
- if (extension &&
- web_contents->GetLastCommittedURL().GetOrigin() == origin_url) {
+ if (extension && url::IsSameOriginWith(
+ origin_url, web_contents->GetLastCommittedURL())) {
*name_out = extension->name();
return true;
}

Powered by Google App Engine
This is Rietveld 408576698