Refactor WebsiteSettings to operate on a SecurityInfo
[chromium-blink-merge.git] / content / shell / browser / layout_test / layout_test_download_manager_delegate.cc
blob12e5d61457a7a4aa27abf8eea4f97e518d0ea0ad
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
3 // found in the LICENSE file.
5 #include "content/shell/browser/layout_test/layout_test_download_manager_delegate.h"
7 #if defined(OS_WIN)
8 #include <windows.h>
9 #include <commdlg.h>
10 #endif
12 #include "base/bind.h"
13 #include "base/command_line.h"
14 #include "base/files/file_util.h"
15 #include "base/logging.h"
16 #include "content/public/browser/download_item.h"
17 #include "content/public/browser/download_manager.h"
18 #include "content/shell/browser/blink_test_controller.h"
19 #include "net/base/filename_util.h"
21 #if defined(OS_WIN)
22 #include "ui/aura/window.h"
23 #include "ui/aura/window_tree_host.h"
24 #endif
26 namespace content {
28 LayoutTestDownloadManagerDelegate::LayoutTestDownloadManagerDelegate()
29 : ShellDownloadManagerDelegate() {}
31 LayoutTestDownloadManagerDelegate::~LayoutTestDownloadManagerDelegate(){
34 bool LayoutTestDownloadManagerDelegate::ShouldOpenDownload(
35 DownloadItem* item,
36 const DownloadOpenDelayedCallback& callback) {
37 if (BlinkTestController::Get()->IsMainWindow(item->GetWebContents()) &&
38 item->GetMimeType() == "text/html") {
39 BlinkTestController::Get()->OpenURL(
40 net::FilePathToFileURL(item->GetFullPath()));
42 return true;
45 } // namespace content