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

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: Merge with trunk Created 5 years, 10 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 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 can_save_as_complete, 421 can_save_as_complete,
422 download_prefs_.get(), 422 download_prefs_.get(),
423 callback); 423 callback);
424 } 424 }
425 425
426 void ChromeDownloadManagerDelegate::OpenDownloadUsingPlatformHandler( 426 void ChromeDownloadManagerDelegate::OpenDownloadUsingPlatformHandler(
427 DownloadItem* download) { 427 DownloadItem* download) {
428 base::FilePath platform_path( 428 base::FilePath platform_path(
429 GetPlatformDownloadPath(profile_, download, PLATFORM_TARGET_PATH)); 429 GetPlatformDownloadPath(profile_, download, PLATFORM_TARGET_PATH));
430 DCHECK(!platform_path.empty()); 430 DCHECK(!platform_path.empty());
431 platform_util::OpenItem(profile_, platform_path); 431 platform_util::OpenItem(profile_, platform_path, platform_util::OPEN_FILE,
432 platform_util::OpenOperationCallback());
432 } 433 }
433 434
434 void ChromeDownloadManagerDelegate::OpenDownload(DownloadItem* download) { 435 void ChromeDownloadManagerDelegate::OpenDownload(DownloadItem* download) {
435 DCHECK_EQ(DownloadItem::COMPLETE, download->GetState()); 436 DCHECK_EQ(DownloadItem::COMPLETE, download->GetState());
436 DCHECK(!download->GetTargetFilePath().empty()); 437 DCHECK(!download->GetTargetFilePath().empty());
437 if (!download->CanOpenDownload()) 438 if (!download->CanOpenDownload())
438 return; 439 return;
439 440
440 if (!DownloadItemModel(download).ShouldPreferOpeningInBrowser()) { 441 if (!DownloadItemModel(download).ShouldPreferOpeningInBrowser()) {
441 RecordDownloadOpenMethod(DOWNLOAD_OPEN_METHOD_DEFAULT_PLATFORM); 442 RecordDownloadOpenMethod(DOWNLOAD_OPEN_METHOD_DEFAULT_PLATFORM);
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 path.MatchesExtension(FILE_PATH_LITERAL(".xht")) || 741 path.MatchesExtension(FILE_PATH_LITERAL(".xht")) ||
741 path.MatchesExtension(FILE_PATH_LITERAL(".xhtm")) || 742 path.MatchesExtension(FILE_PATH_LITERAL(".xhtm")) ||
742 path.MatchesExtension(FILE_PATH_LITERAL(".xhtml")) || 743 path.MatchesExtension(FILE_PATH_LITERAL(".xhtml")) ||
743 path.MatchesExtension(FILE_PATH_LITERAL(".xsl")) || 744 path.MatchesExtension(FILE_PATH_LITERAL(".xsl")) ||
744 path.MatchesExtension(FILE_PATH_LITERAL(".xslt"))) { 745 path.MatchesExtension(FILE_PATH_LITERAL(".xslt"))) {
745 return true; 746 return true;
746 } 747 }
747 #endif 748 #endif
748 return false; 749 return false;
749 } 750 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698