OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_commands.h" | 5 #include "chrome/browser/download/download_commands.h" |
6 | 6 |
7 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/download/download_crx_util.h" | 9 #include "chrome/browser/download/download_crx_util.h" |
10 #include "chrome/browser/download/download_extensions.h" | 10 #include "chrome/browser/download/download_extensions.h" |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 return browser_displayer.browser(); | 225 return browser_displayer.browser(); |
226 } | 226 } |
227 | 227 |
228 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) | 228 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) |
229 bool DownloadCommands::IsDownloadPdf() const { | 229 bool DownloadCommands::IsDownloadPdf() const { |
230 base::FilePath path = download_item_->GetTargetFilePath(); | 230 base::FilePath path = download_item_->GetTargetFilePath(); |
231 return path.MatchesExtension(FILE_PATH_LITERAL(".pdf")); | 231 return path.MatchesExtension(FILE_PATH_LITERAL(".pdf")); |
232 } | 232 } |
233 #endif | 233 #endif |
234 | 234 |
| 235 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) |
235 bool DownloadCommands::CanOpenPdfInSystemViewer() const { | 236 bool DownloadCommands::CanOpenPdfInSystemViewer() const { |
236 #if defined(OS_WIN) | 237 #if defined(OS_WIN) |
237 bool is_adobe_pdf_reader_up_to_date = false; | 238 bool is_adobe_pdf_reader_up_to_date = false; |
238 if (IsDownloadPdf() && IsAdobeReaderDefaultPDFViewer()) { | 239 if (IsDownloadPdf() && IsAdobeReaderDefaultPDFViewer()) { |
239 is_adobe_pdf_reader_up_to_date = | 240 is_adobe_pdf_reader_up_to_date = |
240 DownloadTargetDeterminer::IsAdobeReaderUpToDate(); | 241 DownloadTargetDeterminer::IsAdobeReaderUpToDate(); |
241 } | 242 } |
242 return IsDownloadPdf() && | 243 return IsDownloadPdf() && |
243 (IsAdobeReaderDefaultPDFViewer() ? is_adobe_pdf_reader_up_to_date | 244 (IsAdobeReaderDefaultPDFViewer() ? is_adobe_pdf_reader_up_to_date |
244 : true); | 245 : true); |
245 #elif defined(OS_MACOSX) || defined(OS_LINUX) | 246 #elif defined(OS_MACOSX) || defined(OS_LINUX) |
246 return IsDownloadPdf(); | 247 return IsDownloadPdf(); |
247 #endif | 248 #endif |
248 } | 249 } |
| 250 #endif // #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) |
OLD | NEW |