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

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: license stanza 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
« no previous file with comments | « chrome/browser/ui/extensions/shell_window.h ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 62790527106b3f29f6dd1727b0788994680cce2d..e54a48d3d8edb5838ee313bf221be81091b13dd7 100644
--- a/chrome/browser/ui/extensions/shell_window.cc
+++ b/chrome/browser/ui/extensions/shell_window.cc
@@ -116,7 +116,8 @@ content::WebContents* ExternalUrlController::OpenURLFromTab(
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() {
@@ -179,10 +180,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) {
+ SuspendRenderViewHost(web_contents_->GetRenderViewHost());
+ } else {
+ VLOG(1) << "ShellWindow created in new process ("
+ << 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
« no previous file with comments | « chrome/browser/ui/extensions/shell_window.h ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698