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/safe_browsing/download_protection_service.h" | 5 #include "chrome/browser/safe_browsing/download_protection_service.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 1625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1636 void DownloadProtectionService::ShowDetailsForDownload( | 1636 void DownloadProtectionService::ShowDetailsForDownload( |
1637 const content::DownloadItem& item, | 1637 const content::DownloadItem& item, |
1638 content::PageNavigator* navigator) { | 1638 content::PageNavigator* navigator) { |
1639 GURL learn_more_url(chrome::kDownloadScanningLearnMoreURL); | 1639 GURL learn_more_url(chrome::kDownloadScanningLearnMoreURL); |
1640 learn_more_url = google_util::AppendGoogleLocaleParam( | 1640 learn_more_url = google_util::AppendGoogleLocaleParam( |
1641 learn_more_url, g_browser_process->GetApplicationLocale()); | 1641 learn_more_url, g_browser_process->GetApplicationLocale()); |
1642 learn_more_url = net::AppendQueryParameter( | 1642 learn_more_url = net::AppendQueryParameter( |
1643 learn_more_url, "ctx", | 1643 learn_more_url, "ctx", |
1644 base::IntToString(static_cast<int>(item.GetDangerType()))); | 1644 base::IntToString(static_cast<int>(item.GetDangerType()))); |
1645 navigator->OpenURL( | 1645 navigator->OpenURL( |
1646 content::OpenURLParams(learn_more_url, | 1646 content::OpenURLParams(learn_more_url, content::Referrer(), |
1647 content::Referrer(), | 1647 WindowOpenDisposition::NEW_FOREGROUND_TAB, |
1648 NEW_FOREGROUND_TAB, | 1648 ui::PAGE_TRANSITION_LINK, false)); |
1649 ui::PAGE_TRANSITION_LINK, | |
1650 false)); | |
1651 } | 1649 } |
1652 | 1650 |
1653 void DownloadProtectionService::SetDownloadPingToken( | 1651 void DownloadProtectionService::SetDownloadPingToken( |
1654 content::DownloadItem* item, const std::string& token) { | 1652 content::DownloadItem* item, const std::string& token) { |
1655 if (item) | 1653 if (item) |
1656 item->SetUserData(kDownloadPingTokenKey, new DownloadPingToken(token)); | 1654 item->SetUserData(kDownloadPingTokenKey, new DownloadPingToken(token)); |
1657 } | 1655 } |
1658 | 1656 |
1659 std::string DownloadProtectionService::GetDownloadPingToken( | 1657 std::string DownloadProtectionService::GetDownloadPingToken( |
1660 const content::DownloadItem* item) { | 1658 const content::DownloadItem* item) { |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1747 GURL DownloadProtectionService::GetDownloadRequestUrl() { | 1745 GURL DownloadProtectionService::GetDownloadRequestUrl() { |
1748 GURL url(kDownloadRequestUrl); | 1746 GURL url(kDownloadRequestUrl); |
1749 std::string api_key = google_apis::GetAPIKey(); | 1747 std::string api_key = google_apis::GetAPIKey(); |
1750 if (!api_key.empty()) | 1748 if (!api_key.empty()) |
1751 url = url.Resolve("?key=" + net::EscapeQueryParamValue(api_key, true)); | 1749 url = url.Resolve("?key=" + net::EscapeQueryParamValue(api_key, true)); |
1752 | 1750 |
1753 return url; | 1751 return url; |
1754 } | 1752 } |
1755 | 1753 |
1756 } // namespace safe_browsing | 1754 } // namespace safe_browsing |
OLD | NEW |