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

Unified Diff: chrome/browser/ui/extensions/shell_window.cc

Issue 11048045: Allow settings dialog to be opened via the app launcher, as a packaged app. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: stray GetSiteInstance in DLOG Created 8 years, 2 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/extensions/shell_window.cc
diff --git a/chrome/browser/ui/extensions/shell_window.cc b/chrome/browser/ui/extensions/shell_window.cc
index fa3e848f33454e88f744523709a8b5077b3b67be..9626ef0e511443e4d95bb6df8f219e260176f204 100644
--- a/chrome/browser/ui/extensions/shell_window.cc
+++ b/chrome/browser/ui/extensions/shell_window.cc
@@ -68,7 +68,8 @@ void SuspendRenderViewHost(RenderViewHost* rvh) {
ShellWindow::CreateParams::CreateParams()
: frame(ShellWindow::CreateParams::FRAME_CHROME),
bounds(-1, -1, kDefaultWidth, kDefaultHeight),
- restore_position(true), restore_size(true) {
+ restore_position(true), restore_size(true),
+ creator_process_id(0) {
}
ShellWindow::CreateParams::~CreateParams() {
@@ -131,10 +132,19 @@ void ShellWindow::Init(const GURL& url,
}
}
-
- // Block the created RVH from loading anything until the background page
- // has had a chance to do any initialization it wants.
- SuspendRenderViewHost(web_contents_->GetRenderViewHost());
+ // If the new view is in the same process as the creator, block the created
+ // RVH from loading anything until the background page has had a chance to do
+ // any initialization it wants. If it's a different process, the new RVH
+ // shouldn't communicate with the background page anyway (e.g. sandboxed).
+ if (web_contents_->GetRenderViewHost()->GetProcess()->GetID()
+ == params.creator_process_id) {
sky 2012/10/12 16:30:21 == on previous line.
tapted 2012/10/15 02:32:39 Done.
+ SuspendRenderViewHost(web_contents_->GetRenderViewHost());
+ } else {
+ DLOG(INFO) << "ShellWindow created in new process ("
sky 2012/10/12 16:30:21 VLOG
tapted 2012/10/15 02:32:39 Done.
+ << web_contents_->GetRenderViewHost()->GetProcess()->GetID()
+ << ") != creator (" << params.creator_process_id
+ << "). Routing disabled.";
+ }
// TODO(jeremya): there's a bug where navigating a web contents to an
// extension URL causes it to create a new RVH and discard the old (perfectly

Powered by Google App Engine
This is Rietveld 408576698