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

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

Issue 352393002: Be explicit about target type in platform_util::OpenItem() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Catch up with changes to JSONStringValueSerializer and address CrOS comment Created 5 years, 9 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
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 "chrome/browser/download/chrome_download_manager_delegate.h" 5 #include "chrome/browser/download/chrome_download_manager_delegate.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 can_save_as_complete, 426 can_save_as_complete,
427 download_prefs_.get(), 427 download_prefs_.get(),
428 callback); 428 callback);
429 } 429 }
430 430
431 void ChromeDownloadManagerDelegate::OpenDownloadUsingPlatformHandler( 431 void ChromeDownloadManagerDelegate::OpenDownloadUsingPlatformHandler(
432 DownloadItem* download) { 432 DownloadItem* download) {
433 base::FilePath platform_path( 433 base::FilePath platform_path(
434 GetPlatformDownloadPath(profile_, download, PLATFORM_TARGET_PATH)); 434 GetPlatformDownloadPath(profile_, download, PLATFORM_TARGET_PATH));
435 DCHECK(!platform_path.empty()); 435 DCHECK(!platform_path.empty());
436 platform_util::OpenItem(profile_, platform_path); 436 platform_util::OpenItem(profile_, platform_path, platform_util::OPEN_FILE,
437 platform_util::OpenOperationCallback());
437 } 438 }
438 439
439 void ChromeDownloadManagerDelegate::OpenDownload(DownloadItem* download) { 440 void ChromeDownloadManagerDelegate::OpenDownload(DownloadItem* download) {
440 DCHECK_EQ(DownloadItem::COMPLETE, download->GetState()); 441 DCHECK_EQ(DownloadItem::COMPLETE, download->GetState());
441 DCHECK(!download->GetTargetFilePath().empty()); 442 DCHECK(!download->GetTargetFilePath().empty());
442 if (!download->CanOpenDownload()) 443 if (!download->CanOpenDownload())
443 return; 444 return;
444 445
445 if (!DownloadItemModel(download).ShouldPreferOpeningInBrowser()) { 446 if (!DownloadItemModel(download).ShouldPreferOpeningInBrowser()) {
446 RecordDownloadOpenMethod(DOWNLOAD_OPEN_METHOD_DEFAULT_PLATFORM); 447 RecordDownloadOpenMethod(DOWNLOAD_OPEN_METHOD_DEFAULT_PLATFORM);
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
751 path.MatchesExtension(FILE_PATH_LITERAL(".xht")) || 752 path.MatchesExtension(FILE_PATH_LITERAL(".xht")) ||
752 path.MatchesExtension(FILE_PATH_LITERAL(".xhtm")) || 753 path.MatchesExtension(FILE_PATH_LITERAL(".xhtm")) ||
753 path.MatchesExtension(FILE_PATH_LITERAL(".xhtml")) || 754 path.MatchesExtension(FILE_PATH_LITERAL(".xhtml")) ||
754 path.MatchesExtension(FILE_PATH_LITERAL(".xsl")) || 755 path.MatchesExtension(FILE_PATH_LITERAL(".xsl")) ||
755 path.MatchesExtension(FILE_PATH_LITERAL(".xslt"))) { 756 path.MatchesExtension(FILE_PATH_LITERAL(".xslt"))) {
756 return true; 757 return true;
757 } 758 }
758 #endif 759 #endif
759 return false; 760 return false;
760 } 761 }
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/file_manager/open_util.cc ('k') | chrome/browser/extensions/api/downloads/downloads_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698