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

Side by Side Diff: content/shell/shell_download_manager_delegate.cc

Issue 15979019: [content shell] further restrict what files to open during layout tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
« 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/shell_download_manager_delegate.h" 5 #include "content/shell/shell_download_manager_delegate.h"
6 6
7 #if defined(TOOLKIT_GTK) 7 #if defined(TOOLKIT_GTK)
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 #endif 9 #endif
10 10
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 &ShellDownloadManagerDelegate::GenerateFilename, 84 &ShellDownloadManagerDelegate::GenerateFilename,
85 this, download->GetId(), callback, generated_name, 85 this, download->GetId(), callback, generated_name,
86 default_download_path_)); 86 default_download_path_));
87 return true; 87 return true;
88 } 88 }
89 89
90 bool ShellDownloadManagerDelegate::ShouldOpenDownload( 90 bool ShellDownloadManagerDelegate::ShouldOpenDownload(
91 DownloadItem* item, 91 DownloadItem* item,
92 const DownloadOpenDelayedCallback& callback) { 92 const DownloadOpenDelayedCallback& callback) {
93 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree) && 93 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree) &&
94 WebKitTestController::Get()->IsMainWindow(item->GetWebContents())) { 94 WebKitTestController::Get()->IsMainWindow(item->GetWebContents()) &&
95 item->GetMimeType() == "text/html") {
95 WebKitTestController::Get()->OpenURL( 96 WebKitTestController::Get()->OpenURL(
96 net::FilePathToFileURL(item->GetFullPath())); 97 net::FilePathToFileURL(item->GetFullPath()));
97 } 98 }
98 return true; 99 return true;
99 } 100 }
100 101
101 void ShellDownloadManagerDelegate::GenerateFilename( 102 void ShellDownloadManagerDelegate::GenerateFilename(
102 int32 download_id, 103 int32 download_id,
103 const DownloadTargetCallback& callback, 104 const DownloadTargetCallback& callback,
104 const base::FilePath& generated_name, 105 const base::FilePath& generated_name,
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, result); 195 DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, result);
195 } 196 }
196 197
197 void ShellDownloadManagerDelegate::SetDownloadBehaviorForTesting( 198 void ShellDownloadManagerDelegate::SetDownloadBehaviorForTesting(
198 const base::FilePath& default_download_path) { 199 const base::FilePath& default_download_path) {
199 default_download_path_ = default_download_path; 200 default_download_path_ = default_download_path;
200 suppress_prompting_ = true; 201 suppress_prompting_ = true;
201 } 202 }
202 203
203 } // namespace content 204 } // 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