| OLD | NEW |
| 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 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 if (!browser || | 443 if (!browser || |
| 444 !browser->CanSupportWindowFeature(Browser::FEATURE_TABSTRIP)) { | 444 !browser->CanSupportWindowFeature(Browser::FEATURE_TABSTRIP)) { |
| 445 browser_displayer.reset(new chrome::ScopedTabbedBrowserDisplayer( | 445 browser_displayer.reset(new chrome::ScopedTabbedBrowserDisplayer( |
| 446 profile_, chrome::GetActiveDesktop())); | 446 profile_, chrome::GetActiveDesktop())); |
| 447 browser = browser_displayer->browser(); | 447 browser = browser_displayer->browser(); |
| 448 } | 448 } |
| 449 content::OpenURLParams params( | 449 content::OpenURLParams params( |
| 450 net::FilePathToFileURL(download->GetTargetFilePath()), | 450 net::FilePathToFileURL(download->GetTargetFilePath()), |
| 451 content::Referrer(), | 451 content::Referrer(), |
| 452 NEW_FOREGROUND_TAB, | 452 NEW_FOREGROUND_TAB, |
| 453 content::PAGE_TRANSITION_LINK, | 453 ui::PAGE_TRANSITION_LINK, |
| 454 false); | 454 false); |
| 455 browser->OpenURL(params); | 455 browser->OpenURL(params); |
| 456 RecordDownloadOpenMethod(DOWNLOAD_OPEN_METHOD_DEFAULT_BROWSER); | 456 RecordDownloadOpenMethod(DOWNLOAD_OPEN_METHOD_DEFAULT_BROWSER); |
| 457 #else | 457 #else |
| 458 // ShouldPreferOpeningInBrowser() should never be true on Android. | 458 // ShouldPreferOpeningInBrowser() should never be true on Android. |
| 459 NOTREACHED(); | 459 NOTREACHED(); |
| 460 #endif | 460 #endif |
| 461 } | 461 } |
| 462 | 462 |
| 463 void ChromeDownloadManagerDelegate::ShowDownloadInShell( | 463 void ChromeDownloadManagerDelegate::ShowDownloadInShell( |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 733 path.MatchesExtension(FILE_PATH_LITERAL(".xht")) || | 733 path.MatchesExtension(FILE_PATH_LITERAL(".xht")) || |
| 734 path.MatchesExtension(FILE_PATH_LITERAL(".xhtm")) || | 734 path.MatchesExtension(FILE_PATH_LITERAL(".xhtm")) || |
| 735 path.MatchesExtension(FILE_PATH_LITERAL(".xhtml")) || | 735 path.MatchesExtension(FILE_PATH_LITERAL(".xhtml")) || |
| 736 path.MatchesExtension(FILE_PATH_LITERAL(".xsl")) || | 736 path.MatchesExtension(FILE_PATH_LITERAL(".xsl")) || |
| 737 path.MatchesExtension(FILE_PATH_LITERAL(".xslt"))) { | 737 path.MatchesExtension(FILE_PATH_LITERAL(".xslt"))) { |
| 738 return true; | 738 return true; |
| 739 } | 739 } |
| 740 #endif | 740 #endif |
| 741 return false; | 741 return false; |
| 742 } | 742 } |
| OLD | NEW |