Chromium Code Reviews| Index: chrome/browser/extensions/extension_host.cc |
| diff --git a/chrome/browser/extensions/extension_host.cc b/chrome/browser/extensions/extension_host.cc |
| index ff721c6958adf61d3824fcf6d00fd95618694a09..6530e0b3181ecf1203045895bfeef3de54c1b4c0 100644 |
| --- a/chrome/browser/extensions/extension_host.cc |
| +++ b/chrome/browser/extensions/extension_host.cc |
| @@ -58,6 +58,7 @@ |
| using WebKit::WebDragOperation; |
| using WebKit::WebDragOperationsMask; |
| +using content::DownloadItem; |
| using content::NativeWebKeyboardEvent; |
| using content::OpenURLParams; |
| using content::RenderViewHost; |
| @@ -409,6 +410,20 @@ void ExtensionHost::CloseContents(WebContents* contents) { |
| } |
| } |
| +void ExtensionHost::OnStartDownload( |
| + WebContents* source, DownloadItem* download) { |
| + Profile* profile = Profile::FromBrowserContext(source->GetBrowserContext()); |
| + Browser* browser = browser::FindTabbedBrowser( |
| + profile, false); // Match incognito exactly. |
| + if (!browser && view()) |
| + browser = view()->browser(); |
| + if (browser) |
| + // I don't know why Browser::OnStartDownload() is private when |
| + // WebContentsDelegate::OnStartDownload() is public. Seems silly to me. |
|
Avi (use Gerrit)
2012/05/23 20:53:28
Then fix it.
benjhayden
2012/05/24 20:43:39
Done.
|
| + static_cast<content::WebContentsDelegate*>(browser)->OnStartDownload( |
| + source, download); |
| +} |
| + |
| void ExtensionHost::WillRunJavaScriptDialog() { |
| ExtensionProcessManager* pm = |
| ExtensionSystem::Get(profile_)->process_manager(); |