Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Resolve #206: Add ability to download files from the browser. #1289

Merged
merged 14 commits into from
Aug 27, 2019

Conversation

iccub
Copy link
Contributor

@iccub iccub commented Jul 24, 2019

All of file download logic and Downloads panel is taken from Firefox.
What was implemented by me:

  • download prompt is new
  • new menu entry for downloads panel

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • My patch or PR title has a standard commit message that looks like Fix #123: This fixes the shattered coffee cup! (or No Bug: <message> if no relevant ticket)
  • Unit Tests are updated to cover new or changed functionality
  • User-facing strings use NSLocalizableString()
  • New files have MPL-2.0 license header.

Test Plan:

Screenshots:

Reviewer Checklist:

  • PR is linked to an issue via Zenhub.
  • Issues are assigned to at least one epic.
  • Issues include necessary QA labels:
    • QA/(Yes|No)
    • release-notes/(include|exclude)
    • bug / enhancement
  • Necessary security reviews have taken place.
  • Adequate test coverage exists to prevent regressions.
  • Adequate test plan exists for QA to validate (if applicable)

@iccub iccub force-pushed the feature/download_manager branch 3 times, most recently from 7f15168 to 40414a8 Compare August 6, 2019 17:41
@iccub iccub marked this pull request as ready for review August 6, 2019 17:43
@iccub iccub changed the title Files downloader Resolve #206: Add ability to download files from the browser. Aug 6, 2019
@iccub iccub force-pushed the feature/download_manager branch from 40414a8 to a581416 Compare August 9, 2019 16:38
@jumde
Copy link
Contributor

jumde commented Aug 9, 2019

Running into a crash

(lldb) bt 5
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    frame #0: 0x000000021a8990dc libsystem_kernel.dylib`__pthread_kill + 8
    frame #1: 0x000000021a912094 libsystem_pthread.dylib`pthread_kill$VARIANT$mp + 380
    frame #2: 0x000000021a7f2ea8 libsystem_c.dylib`abort + 140
    frame #3: 0x0000000219ebf788 libc++abi.dylib`abort_message + 132
    frame #4: 0x0000000219ebf934 libc++abi.dylib`default_terminate_handler() + 308

STR:

  1. Navigate to http://cyberside.net.ee/ripping/
  2. Click on 1click-bluray-copy_v1.0.0.6beta.exe

@jumde
Copy link
Contributor

jumde commented Aug 9, 2019

  • Downloads in the private-tab are visible in the download panel in the normal tab. I think its okay to keep the files, but we should remove the reference from the normal ( mimics the behavior on desktop )

@jumde
Copy link
Contributor

jumde commented Aug 9, 2019

  • Clear Private Data does not clear downloads.

@jhreis jhreis added the blocked If a ticket is blocked for some reason, if not using a sub-block label, please provide info in issue label Aug 13, 2019
@jhreis
Copy link
Contributor

jhreis commented Aug 13, 2019

I am blocking this beyond security review. Please DO NOT MERGE, until talking with me. There are some timing mechanics that need to be worked out.

@@ -152,5 +152,7 @@
<string></string>
</dict>
</array>
<key>UIFileSharingEnabled</key>
<string>YES</string>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be a bool <true/>, will probably need to edit the plaintext, as I see Xcode has it stuck as a string type.

@@ -27,6 +27,8 @@ extension Strings {
public static let OpenNewPrivateTabButtonTitle = NSLocalizedString("OpenNewPrivateTabButtonTitle", tableName: "BraveShared", bundle: Bundle.braveShared, value: "Open in New Private Tab", comment: "Context menu option for opening a link in a new private tab")
public static let DeleteLoginButtonTitle = NSLocalizedString("DeleteLoginButtonTitle", tableName: "BraveShared", bundle: Bundle.braveShared, value: "Delete", comment: "Label for the button used to delete the current login.")
public static let SaveButtonTitle = NSLocalizedString("SaveButtonTitle", tableName: "BraveShared", bundle: Bundle.braveShared, value: "Save", comment: "Label for the button used to save data")
public static let Share = NSLocalizedString("CommonShare", tableName: "BraveShared", bundle: Bundle.braveShared, value: "Share", comment: "Text for share action")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this comment could be a bit more clear, it is for translators, so something more like:

Text to select sharing something (example: image, video, URL)

@@ -27,6 +27,8 @@ extension Strings {
public static let OpenNewPrivateTabButtonTitle = NSLocalizedString("OpenNewPrivateTabButtonTitle", tableName: "BraveShared", bundle: Bundle.braveShared, value: "Open in New Private Tab", comment: "Context menu option for opening a link in a new private tab")
public static let DeleteLoginButtonTitle = NSLocalizedString("DeleteLoginButtonTitle", tableName: "BraveShared", bundle: Bundle.braveShared, value: "Delete", comment: "Label for the button used to delete the current login.")
public static let SaveButtonTitle = NSLocalizedString("SaveButtonTitle", tableName: "BraveShared", bundle: Bundle.braveShared, value: "Save", comment: "Label for the button used to save data")
public static let Share = NSLocalizedString("CommonShare", tableName: "BraveShared", bundle: Bundle.braveShared, value: "Share", comment: "Text for share action")
public static let Download = NSLocalizedString("CommonDownload", tableName: "BraveShared", bundle: Bundle.braveShared, value: "Download", comment: "Text for download action")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, maybe:

Text to choose for downloading a file (example: saving an image to phone)

@@ -512,6 +514,8 @@ extension Strings {
public static let SettingsMenuItem = NSLocalizedString("SettingsMenuItem", tableName: "BraveShared", bundle: Bundle.braveShared, value: "Settings", comment: "Title for settings menu item")
public static let AddToMenuItem = NSLocalizedString("AddToMenuItem", tableName: "BraveShared", bundle: Bundle.braveShared, value: "Add to...", comment: "Title for adding new bookmark menu item")
public static let ShareWithMenuItem = NSLocalizedString("ShareWithMenuItem", tableName: "BraveShared", bundle: Bundle.braveShared, value: "Share with...", comment: "Title for sharing url menu item")
public static let DownloadsMenuItem = NSLocalizedString("DownloadsMenuItem", tableName: "BraveShared", bundle: Bundle.braveShared, value: "Downloads", comment: "Title for downloads menu item")
public static let DownloadsPanelEmptyStateTitle = NSLocalizedString("DownloadsPanelEmptyStateTitle", tableName: "BraveShared", bundle: Bundle.braveShared, value: "Downloaded files will show up here.", comment: "Title for the Downloads screen empty state.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment maybe:

Title for when a user has nothing downloaded onto their device, and the list is empty.

@jhreis
Copy link
Contributor

jhreis commented Aug 22, 2019

Talked with @jumde, we can add a new check list item in Clear Private Data specifically for "downloads".

@iccub iccub force-pushed the feature/download_manager branch from 6c5484d to b032660 Compare August 22, 2019 12:57
@jhreis
Copy link
Contributor

jhreis commented Aug 23, 2019

We are still blocked on:

@jumde
Copy link
Contributor

jumde commented Aug 26, 2019

Updated text:

Private Tabs aren’t saved in Brave, but they don’t make you anonymous online. Sites you visit in a private tab won’t show up in your history and their cookies always vanish when you close them — there won’t be any trace of them left in Brave. However, downloads will be saved.

Your mobile carrier (or the owner of the WiFi network or VPN you’re connected to) can see which sites you visit and those sites will learn your public IP address, even in Private Tabs.

@jumde jumde self-requested a review August 26, 2019 20:15
@iccub iccub force-pushed the feature/download_manager branch from e4a5c32 to 532b658 Compare August 26, 2019 22:27
@iccub
Copy link
Contributor Author

iccub commented Aug 26, 2019

Updated text

Zrzut ekranu 2019-08-27 o 00 17 23

@jhreis jhreis removed the blocked If a ticket is blocked for some reason, if not using a sub-block label, please provide info in issue label Aug 27, 2019
@jhreis jhreis merged commit 5330bb3 into brave:development Aug 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants