Skip to content

Commit

Permalink
Bug 18101: Suppress upload file dialog proxy bypass (linux)
Browse files Browse the repository at this point in the history
  • Loading branch information
arthuredelstein committed Sep 20, 2017
1 parent 1eeaa47 commit f657d0c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
14 changes: 3 additions & 11 deletions widget/gtk/nsFilePicker.cpp
Expand Up @@ -170,7 +170,6 @@ NS_IMPL_ISUPPORTS(nsFilePicker, nsIFilePicker)
nsFilePicker::nsFilePicker()
: mSelectedType(0)
, mRunning(false)
, mAllowURLs(false)
#if (MOZ_WIDGET_GTK == 3)
, mFileChooserDelegate(nullptr)
#endif
Expand Down Expand Up @@ -239,13 +238,6 @@ nsFilePicker::InitNative(nsIWidget *aParent,
mTitle.Assign(aTitle);
}

NS_IMETHODIMP
nsFilePicker::AppendFilters(int32_t aFilterMask)
{
mAllowURLs = !!(aFilterMask & filterAllowURLs);
return nsBaseFilePicker::AppendFilters(aFilterMask);
}

NS_IMETHODIMP
nsFilePicker::AppendFilter(const nsAString& aTitle, const nsAString& aFilter)
{
Expand Down Expand Up @@ -402,9 +394,9 @@ nsFilePicker::Open(nsIFilePickerShownCallback *aCallback)
GTK_RESPONSE_ACCEPT,
GTK_RESPONSE_CANCEL,
-1);
if (mAllowURLs) {
gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(file_chooser), FALSE);
}

// Don't allow remote URLs.
gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(file_chooser), TRUE);

if (action == GTK_FILE_CHOOSER_ACTION_OPEN || action == GTK_FILE_CHOOSER_ACTION_SAVE) {
GtkWidget *img_preview = gtk_image_new();
Expand Down
2 changes: 0 additions & 2 deletions widget/gtk/nsFilePicker.h
Expand Up @@ -25,7 +25,6 @@ class nsFilePicker : public nsBaseFilePicker

// nsIFilePicker (less what's in nsBaseFilePicker)
NS_IMETHOD Open(nsIFilePickerShownCallback *aCallback) override;
NS_IMETHOD AppendFilters(int32_t aFilterMask) override;
NS_IMETHOD AppendFilter(const nsAString& aTitle,
const nsAString& aFilter) override;
NS_IMETHOD SetDefaultString(const nsAString& aString) override;
Expand Down Expand Up @@ -62,7 +61,6 @@ class nsFilePicker : public nsBaseFilePicker
int16_t mSelectedType;
int16_t mResult;
bool mRunning;
bool mAllowURLs;
nsCString mFileURL;
nsString mTitle;
nsString mDefault;
Expand Down

0 comments on commit f657d0c

Please sign in to comment.