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/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 return; | 452 return; |
453 } | 453 } |
454 | 454 |
455 #if !defined(OS_ANDROID) | 455 #if !defined(OS_ANDROID) |
456 content::WebContents* web_contents = download->GetWebContents(); | 456 content::WebContents* web_contents = download->GetWebContents(); |
457 Browser* browser = | 457 Browser* browser = |
458 web_contents ? chrome::FindBrowserWithWebContents(web_contents) : NULL; | 458 web_contents ? chrome::FindBrowserWithWebContents(web_contents) : NULL; |
459 scoped_ptr<chrome::ScopedTabbedBrowserDisplayer> browser_displayer; | 459 scoped_ptr<chrome::ScopedTabbedBrowserDisplayer> browser_displayer; |
460 if (!browser || | 460 if (!browser || |
461 !browser->CanSupportWindowFeature(Browser::FEATURE_TABSTRIP)) { | 461 !browser->CanSupportWindowFeature(Browser::FEATURE_TABSTRIP)) { |
462 browser_displayer.reset(new chrome::ScopedTabbedBrowserDisplayer( | 462 browser_displayer.reset(new chrome::ScopedTabbedBrowserDisplayer(profile_)); |
463 profile_, chrome::GetActiveDesktop())); | |
464 browser = browser_displayer->browser(); | 463 browser = browser_displayer->browser(); |
465 } | 464 } |
466 content::OpenURLParams params( | 465 content::OpenURLParams params( |
467 net::FilePathToFileURL(download->GetTargetFilePath()), | 466 net::FilePathToFileURL(download->GetTargetFilePath()), |
468 content::Referrer(), | 467 content::Referrer(), |
469 NEW_FOREGROUND_TAB, | 468 NEW_FOREGROUND_TAB, |
470 ui::PAGE_TRANSITION_LINK, | 469 ui::PAGE_TRANSITION_LINK, |
471 false); | 470 false); |
472 | 471 |
473 if (download->GetMimeType() == "application/x-x509-user-cert") | 472 if (download->GetMimeType() == "application/x-x509-user-cert") |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
773 path.MatchesExtension(FILE_PATH_LITERAL(".xht")) || | 772 path.MatchesExtension(FILE_PATH_LITERAL(".xht")) || |
774 path.MatchesExtension(FILE_PATH_LITERAL(".xhtm")) || | 773 path.MatchesExtension(FILE_PATH_LITERAL(".xhtm")) || |
775 path.MatchesExtension(FILE_PATH_LITERAL(".xhtml")) || | 774 path.MatchesExtension(FILE_PATH_LITERAL(".xhtml")) || |
776 path.MatchesExtension(FILE_PATH_LITERAL(".xsl")) || | 775 path.MatchesExtension(FILE_PATH_LITERAL(".xsl")) || |
777 path.MatchesExtension(FILE_PATH_LITERAL(".xslt"))) { | 776 path.MatchesExtension(FILE_PATH_LITERAL(".xslt"))) { |
778 return true; | 777 return true; |
779 } | 778 } |
780 #endif | 779 #endif |
781 return false; | 780 return false; |
782 } | 781 } |
OLD | NEW |