diff options
author | Michal Klocek <michal.klocek@qt.io> | 2018-06-15 15:10:01 +0200 |
---|---|---|
committer | Michal Klocek <michal.klocek@qt.io> | 2018-07-09 19:22:21 +0000 |
commit | 490fdc9bc547b8c10f7e0daf5c898b4548d7309d (patch) | |
tree | d95084f8082b4d376c936156b3c4d50de90d7f64 /src/core/download_manager_delegate_qt.cpp | |
parent | d599aea151a5c7753e7eb1fc1a2c2b5953ac580b (diff) |
Rename BrowserAdapterClient to ProfileAdapterClient
Change-Id: I1f8c0d2e59c2565b24c8c636553f1b70bcd31774
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Diffstat (limited to 'src/core/download_manager_delegate_qt.cpp')
-rw-r--r-- | src/core/download_manager_delegate_qt.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/src/core/download_manager_delegate_qt.cpp b/src/core/download_manager_delegate_qt.cpp index 720f88d1f..813657365 100644 --- a/src/core/download_manager_delegate_qt.cpp +++ b/src/core/download_manager_delegate_qt.cpp @@ -52,7 +52,7 @@ #include <QMimeDatabase> #include <QStandardPaths> -#include "browser_context_adapter_client.h" +#include "profile_adapter_client.h" #include "profile_adapter.h" #include "profile_qt.h" #include "qtwebenginecoreglobal.h" @@ -125,14 +125,14 @@ bool DownloadManagerDelegateQt::DetermineDownloadTarget(download::DownloadItem* int downloadType = 0; if (m_nextDownloadIsUserRequested) { - downloadType = BrowserContextAdapterClient::UserRequested; + downloadType = ProfileAdapterClient::UserRequested; m_nextDownloadIsUserRequested = false; } else { bool isAttachment = net::HttpContentDisposition(item->GetContentDisposition(), std::string()).is_attachment(); if (isAttachment) - downloadType = BrowserContextAdapterClient::Attachment; + downloadType = ProfileAdapterClient::Attachment; else - downloadType = BrowserContextAdapterClient::DownloadAttribute; + downloadType = ProfileAdapterClient::DownloadAttribute; } if (suggestedFilename.isEmpty()) @@ -166,9 +166,9 @@ bool DownloadManagerDelegateQt::DetermineDownloadTarget(download::DownloadItem* } item->AddObserver(this); - QList<BrowserContextAdapterClient*> clients = m_profileAdapter->clients(); + QList<ProfileAdapterClient*> clients = m_profileAdapter->clients(); if (!clients.isEmpty()) { - BrowserContextAdapterClient::DownloadItemInfo info = { + ProfileAdapterClient::DownloadItemInfo info = { item->GetId(), toQt(item->GetURL()), item->GetState(), @@ -176,7 +176,7 @@ bool DownloadManagerDelegateQt::DetermineDownloadTarget(download::DownloadItem* item->GetReceivedBytes(), mimeTypeString, suggestedFilePath, - BrowserContextAdapterClient::UnknownSavePageFormat, + ProfileAdapterClient::UnknownSavePageFormat, false /* accepted */, false /* paused */, false /* done */, @@ -184,7 +184,7 @@ bool DownloadManagerDelegateQt::DetermineDownloadTarget(download::DownloadItem* item->GetLastReason() }; - for (BrowserContextAdapterClient *client : qAsConst(clients)) { + for (ProfileAdapterClient *client : qAsConst(clients)) { client->downloadRequested(info); if (info.accepted) break; @@ -234,7 +234,7 @@ void DownloadManagerDelegateQt::ChooseSavePath(content::WebContents *web_content Q_UNUSED(default_extension); Q_UNUSED(can_save_as_complete); - QList<BrowserContextAdapterClient*> clients = m_profileAdapter->clients(); + QList<ProfileAdapterClient*> clients = m_profileAdapter->clients(); if (clients.isEmpty()) return; @@ -255,15 +255,15 @@ void DownloadManagerDelegateQt::ChooseSavePath(content::WebContents *web_content suggestedFilePath = downloadDir.absoluteFilePath(suggestedFilePath); } - BrowserContextAdapterClient::SavePageFormat suggestedSaveFormat - = static_cast<BrowserContextAdapterClient::SavePageFormat>(spi.requestedFormat); - if (suggestedSaveFormat == BrowserContextAdapterClient::UnknownSavePageFormat) - suggestedSaveFormat = BrowserContextAdapterClient::MimeHtmlSaveFormat; + ProfileAdapterClient::SavePageFormat suggestedSaveFormat + = static_cast<ProfileAdapterClient::SavePageFormat>(spi.requestedFormat); + if (suggestedSaveFormat == ProfileAdapterClient::UnknownSavePageFormat) + suggestedSaveFormat = ProfileAdapterClient::MimeHtmlSaveFormat; // Clear the delegate's SavePageInfo. It's only valid for the page currently being saved. contentsDelegate->setSavePageInfo(SavePageInfo()); - BrowserContextAdapterClient::DownloadItemInfo info = { + ProfileAdapterClient::DownloadItemInfo info = { m_currentId + 1, toQt(web_contents->GetURL()), download::DownloadItem::IN_PROGRESS, @@ -275,11 +275,11 @@ void DownloadManagerDelegateQt::ChooseSavePath(content::WebContents *web_content acceptedByDefault, false, /* paused */ false, /* done */ - BrowserContextAdapterClient::SavePage, - BrowserContextAdapterClient::NoReason + ProfileAdapterClient::SavePage, + ProfileAdapterClient::NoReason }; - for (BrowserContextAdapterClient *client : qAsConst(clients)) { + for (ProfileAdapterClient *client : qAsConst(clients)) { client->downloadRequested(info); if (info.accepted) break; @@ -321,9 +321,9 @@ void DownloadManagerDelegateQt::savePackageDownloadCreated(download::DownloadIte void DownloadManagerDelegateQt::OnDownloadUpdated(download::DownloadItem *download) { - QList<BrowserContextAdapterClient*> clients = m_profileAdapter->clients(); + QList<ProfileAdapterClient*> clients = m_profileAdapter->clients(); if (!clients.isEmpty()) { - BrowserContextAdapterClient::DownloadItemInfo info = { + ProfileAdapterClient::DownloadItemInfo info = { download->GetId(), toQt(download->GetURL()), download->GetState(), @@ -331,7 +331,7 @@ void DownloadManagerDelegateQt::OnDownloadUpdated(download::DownloadItem *downlo download->GetReceivedBytes(), toQt(download->GetMimeType()), QString(), - BrowserContextAdapterClient::UnknownSavePageFormat, + ProfileAdapterClient::UnknownSavePageFormat, true /* accepted */, download->IsPaused(), download->IsDone(), @@ -339,7 +339,7 @@ void DownloadManagerDelegateQt::OnDownloadUpdated(download::DownloadItem *downlo download->GetLastReason() }; - for (BrowserContextAdapterClient *client : qAsConst(clients)) { + for (ProfileAdapterClient *client : qAsConst(clients)) { client->downloadUpdated(info); } } |