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

Unified Diff: chrome/browser/ui/ime/ime_window.cc

Issue 1756853002: Correctly sets the security origin for the IME window. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed tests. Created 4 years, 10 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/ui/ime/ime_window.cc
diff --git a/chrome/browser/ui/ime/ime_window.cc b/chrome/browser/ui/ime/ime_window.cc
index a8d1a75107c2c3e412fe51ccc6006f5cf9979d57..64dcb96782271950f2f52f5a30da6d6c32d1d8b4 100644
--- a/chrome/browser/ui/ime/ime_window.cc
+++ b/chrome/browser/ui/ime/ime_window.cc
@@ -10,6 +10,7 @@
#include "chrome/browser/ui/ime/ime_window_observer.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/render_frame_host.h"
+#include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents.h"
#include "extensions/common/constants.h"
#include "extensions/common/extension.h"
@@ -28,6 +29,7 @@ namespace ui {
ImeWindow::ImeWindow(Profile* profile,
const extensions::Extension* extension,
+ content::RenderFrameHost* render_frame_host,
const std::string& url,
Mode mode,
const gfx::Rect& bounds)
@@ -46,9 +48,11 @@ ImeWindow::ImeWindow(Profile* profile,
if (!gurl.is_valid())
gurl = extension->GetResourceURL(url);
- content::SiteInstance* instance =
- content::SiteInstance::CreateForURL(profile, gurl);
- content::WebContents::CreateParams create_params(profile, instance);
+ content::WebContents::CreateParams create_params(
+ profile, render_frame_host->GetSiteInstance());
+ create_params.opener_render_process_id =
+ render_frame_host->GetProcess()->GetID();
+ create_params.opener_render_frame_id = render_frame_host->GetRoutingID();
web_contents_.reset(content::WebContents::Create(create_params));
web_contents_->SetDelegate(this);
content::OpenURLParams params(gurl, content::Referrer(), SINGLETON_TAB,

Powered by Google App Engine
This is Rietveld 408576698