| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/download_target_determiner.h" | 5 #include "chrome/browser/download/download_target_determiner.h" |
| 6 | 6 |
| 7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "base/rand_util.h" | 8 #include "base/rand_util.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 | 512 |
| 513 DownloadTargetDeterminer::Result | 513 DownloadTargetDeterminer::Result |
| 514 DownloadTargetDeterminer::DoDetermineIfAdobeReaderUpToDate() { | 514 DownloadTargetDeterminer::DoDetermineIfAdobeReaderUpToDate() { |
| 515 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 515 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 516 | 516 |
| 517 next_state_ = STATE_CHECK_DOWNLOAD_URL; | 517 next_state_ = STATE_CHECK_DOWNLOAD_URL; |
| 518 | 518 |
| 519 #if defined(OS_WIN) | 519 #if defined(OS_WIN) |
| 520 if (!local_path_.MatchesExtension(FILE_PATH_LITERAL(".pdf"))) | 520 if (!local_path_.MatchesExtension(FILE_PATH_LITERAL(".pdf"))) |
| 521 return CONTINUE; | 521 return CONTINUE; |
| 522 if (!IsAdobeReaderDefaultPDFViewer()) | 522 if (!IsAdobeReaderDefaultPDFViewer()) { |
| 523 g_is_adobe_reader_up_to_date_ = false; |
| 523 return CONTINUE; | 524 return CONTINUE; |
| 525 } |
| 524 | 526 |
| 525 base::PostTaskAndReplyWithResult( | 527 base::PostTaskAndReplyWithResult( |
| 526 BrowserThread::GetBlockingPool(), | 528 BrowserThread::GetBlockingPool(), |
| 527 FROM_HERE, | 529 FROM_HERE, |
| 528 base::Bind(&::IsAdobeReaderUpToDate), | 530 base::Bind(&::IsAdobeReaderUpToDate), |
| 529 base::Bind(&DownloadTargetDeterminer::DetermineIfAdobeReaderUpToDateDone, | 531 base::Bind(&DownloadTargetDeterminer::DetermineIfAdobeReaderUpToDateDone, |
| 530 weak_ptr_factory_.GetWeakPtr())); | 532 weak_ptr_factory_.GetWeakPtr())); |
| 531 return QUIT_DOLOOP; | 533 return QUIT_DOLOOP; |
| 532 #else | 534 #else |
| 533 return CONTINUE; | 535 return CONTINUE; |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 877 const base::FilePath& suggested_path) { | 879 const base::FilePath& suggested_path) { |
| 878 return base::FilePath(suggested_path.value() + kCrdownloadSuffix); | 880 return base::FilePath(suggested_path.value() + kCrdownloadSuffix); |
| 879 } | 881 } |
| 880 | 882 |
| 881 #if defined(OS_WIN) | 883 #if defined(OS_WIN) |
| 882 // static | 884 // static |
| 883 bool DownloadTargetDeterminer::IsAdobeReaderUpToDate() { | 885 bool DownloadTargetDeterminer::IsAdobeReaderUpToDate() { |
| 884 return g_is_adobe_reader_up_to_date_; | 886 return g_is_adobe_reader_up_to_date_; |
| 885 } | 887 } |
| 886 #endif | 888 #endif |
| OLD | NEW |