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

Side by Side Diff: chrome/browser/download/save_package.cc

Issue 2830017: Disallow apps with the wrong content type header. (Closed)
Patch Set: Rebase for checkin. Created 10 years, 5 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 | « chrome/browser/download/download_manager.cc ('k') | chrome/browser/extensions/crx_installer.h » ('j') | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/browser/download/save_package.h" 5 #include "chrome/browser/download/save_package.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/i18n/file_util_icu.h" 10 #include "base/i18n/file_util_icu.h"
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 Profile* profile = tab_contents_->profile(); 318 Profile* profile = tab_contents_->profile();
319 if (!profile) { 319 if (!profile) {
320 NOTREACHED(); 320 NOTREACHED();
321 return false; 321 return false;
322 } 322 }
323 323
324 request_context_getter_ = profile->GetRequestContext(); 324 request_context_getter_ = profile->GetRequestContext();
325 325
326 // Create the fake DownloadItem and display the view. 326 // Create the fake DownloadItem and display the view.
327 download_ = new DownloadItem(1, saved_main_file_path_, 0, page_url_, GURL(), 327 download_ = new DownloadItem(1, saved_main_file_path_, 0, page_url_, GURL(),
328 "", FilePath(), Time::Now(), 0, -1, -1, false, false, 328 "", "", FilePath(), Time::Now(), 0, -1, -1, false, false,
329 profile->IsOffTheRecord(), false, false); 329 profile->IsOffTheRecord(), false, false);
330 download_->set_manager(tab_contents_->profile()->GetDownloadManager()); 330 download_->set_manager(tab_contents_->profile()->GetDownloadManager());
331 tab_contents_->OnStartDownload(download_); 331 tab_contents_->OnStartDownload(download_);
332 332
333 // Check save type and process the save page job. 333 // Check save type and process the save page job.
334 if (save_type_ == SAVE_AS_COMPLETE_HTML) { 334 if (save_type_ == SAVE_AS_COMPLETE_HTML) {
335 // Get directory 335 // Get directory
336 DCHECK(!saved_main_directory_path_.empty()); 336 DCHECK(!saved_main_directory_path_.empty());
337 GetAllSavableResourceLinksForCurrentPage(); 337 GetAllSavableResourceLinksForCurrentPage();
338 } else { 338 } else {
(...skipping 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after
1350 int index, void* params) { 1350 int index, void* params) {
1351 SavePackageParam* save_params = reinterpret_cast<SavePackageParam*>(params); 1351 SavePackageParam* save_params = reinterpret_cast<SavePackageParam*>(params);
1352 ContinueSave(save_params, path, index); 1352 ContinueSave(save_params, path, index);
1353 delete save_params; 1353 delete save_params;
1354 } 1354 }
1355 1355
1356 void SavePackage::FileSelectionCanceled(void* params) { 1356 void SavePackage::FileSelectionCanceled(void* params) {
1357 SavePackageParam* save_params = reinterpret_cast<SavePackageParam*>(params); 1357 SavePackageParam* save_params = reinterpret_cast<SavePackageParam*>(params);
1358 delete save_params; 1358 delete save_params;
1359 } 1359 }
OLDNEW
« no previous file with comments | « chrome/browser/download/download_manager.cc ('k') | chrome/browser/extensions/crx_installer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698