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

Side by Side Diff: content/shell/browser/layout_test/layout_test_download_manager_delegate.cc

Issue 2842023003: fix a layout test crash due to no browser window (Closed)
Patch Set: Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/shell/browser/layout_test/layout_test_download_manager_delegat e.h" 5 #include "content/shell/browser/layout_test/layout_test_download_manager_delegat e.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #include <commdlg.h> 9 #include <commdlg.h>
10 #endif 10 #endif
(...skipping 17 matching lines...) Expand all
28 28
29 LayoutTestDownloadManagerDelegate::LayoutTestDownloadManagerDelegate() 29 LayoutTestDownloadManagerDelegate::LayoutTestDownloadManagerDelegate()
30 : ShellDownloadManagerDelegate() {} 30 : ShellDownloadManagerDelegate() {}
31 31
32 LayoutTestDownloadManagerDelegate::~LayoutTestDownloadManagerDelegate(){ 32 LayoutTestDownloadManagerDelegate::~LayoutTestDownloadManagerDelegate(){
33 } 33 }
34 34
35 bool LayoutTestDownloadManagerDelegate::ShouldOpenDownload( 35 bool LayoutTestDownloadManagerDelegate::ShouldOpenDownload(
36 DownloadItem* item, 36 DownloadItem* item,
37 const DownloadOpenDelayedCallback& callback) { 37 const DownloadOpenDelayedCallback& callback) {
38 if (BlinkTestController::Get()->IsMainWindow(item->GetWebContents()) && 38 if (BlinkTestController::Get() &&
39 BlinkTestController::Get()->IsMainWindow(item->GetWebContents()) &&
39 item->GetMimeType() == "text/html") { 40 item->GetMimeType() == "text/html") {
40 BlinkTestController::Get()->OpenURL( 41 BlinkTestController::Get()->OpenURL(
41 net::FilePathToFileURL(item->GetFullPath())); 42 net::FilePathToFileURL(item->GetFullPath()));
42 } 43 }
43 return true; 44 return true;
44 } 45 }
45 46
46 } // namespace content 47 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698