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

Unified Diff: chrome/browser/apps/app_browsertest_util.cc

Issue 1685003002: Plumb the correct owner document through DocumentInit::m_owner. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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/apps/app_browsertest_util.cc
diff --git a/chrome/browser/apps/app_browsertest_util.cc b/chrome/browser/apps/app_browsertest_util.cc
index ebd9e5bcc20f4498f2faefb311b9040e8242def7..bb196148f2c2d7dd3863e49f3dfcf04278be71cf 100644
--- a/chrome/browser/apps/app_browsertest_util.cc
+++ b/chrome/browser/apps/app_browsertest_util.cc
@@ -194,16 +194,24 @@ size_t PlatformAppBrowserTest::GetAppWindowCountForApp(
.size();
}
-AppWindow* PlatformAppBrowserTest::CreateAppWindow(const Extension* extension) {
- return CreateAppWindowFromParams(extension, AppWindow::CreateParams());
+AppWindow* PlatformAppBrowserTest::CreateAppWindow(
+ content::BrowserContext* context,
+ const Extension* extension) {
+ return CreateAppWindowFromParams(context, extension,
+ AppWindow::CreateParams());
}
AppWindow* PlatformAppBrowserTest::CreateAppWindowFromParams(
+ content::BrowserContext* context,
const Extension* extension,
const AppWindow::CreateParams& params) {
AppWindow* window = new AppWindow(browser()->profile(),
new ChromeAppDelegate(true), extension);
- window->Init(GURL(std::string()), new AppWindowContentsImpl(window), params);
+ ProcessManager* process_manager = ProcessManager::Get(context);
+ ExtensionHost* background_host =
+ process_manager->GetBackgroundHostForExtension(extension->id());
+ window->Init(GURL(std::string()), new AppWindowContentsImpl(window),
+ background_host->host_contents()->GetMainFrame(), params);
return window;
}

Powered by Google App Engine
This is Rietveld 408576698