Skip to content
This repository has been archived by the owner on Jan 4, 2019. It is now read-only.

Pull in file chooser from Chromium #349

Closed
wants to merge 4 commits into from

Conversation

sydneyli
Copy link
Contributor

@darkdh darkdh self-assigned this Oct 19, 2017
@darkdh darkdh removed their request for review October 19, 2017 22:48
@darkdh
Copy link
Member

darkdh commented Oct 19, 2017

we can remove web_dialog_helper.h/cc deps and the files

- InfoBarService::FromWebContents(source_contents_),
- infobars::InfoBarDelegate::CHROME_SELECT_FILE_POLICY, nullptr,
- l10n_util::GetStringUTF16(IDS_FILE_SELECTION_DIALOG_INFOBAR), true);
+// SimpleAlertInfoBarDelegate::Create(
Copy link
Member

Choose a reason for hiding this comment

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

We can use #if defined(MUON_CHROMIUM_BUILD) to comment this block

--- a/chrome/browser/ui/chrome_select_file_policy.cc
+++ b/chrome/browser/ui/chrome_select_file_policy.cc
@@ -30,10 +30,12 @@ bool ChromeSelectFilePolicy::CanOpenSelectFileDialog() {
void ChromeSelectFilePolicy::SelectFileDenied() {
// Show the InfoBar saying that file-selection dialogs are disabled.
if (source_contents_) {
+#if !defined(MUON_CHROMIUM_BUILD)
+#ifdef MUON_CHROMIUM_BUILD
Copy link
Member

Choose a reason for hiding this comment

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

This might be confusing.
MUON_CHROMIUM_BUILD is actually Build chromium without muon
see

+ # Build chromium without muon flags

so the previous change is the right one

@@ -637,6 +637,14 @@ BraveBrowserContext::GetIOTaskRunner() {
GetPath(), BrowserThread::GetBlockingPool());
}

base::FilePath BraveBrowserContext::last_selected_directory() {
return GetPrefs()->GetFilePath(prefs::kSelectFileLastDirectory);
Copy link
Collaborator

Choose a reason for hiding this comment

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

we actually have two prefs files. One of them is leftover from electron and is a PrefRegistrySimple so it wasn't compatible with other changes, but it still has a few prefs in it and kSelectFileLastDirectory is one of them AtomBrowserContext::RegisterPrefs. Checking with @bbondy to see if we care about migrating it (in which case we should handle it like kDownloadDefaultDirectory), otherwise we should remove it from AtomBrowserContext

Copy link
Collaborator

Choose a reason for hiding this comment

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

also it should be registered in BraveBrowserContext with RegisterFilePathPref

Copy link
Collaborator

Choose a reason for hiding this comment

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

sounds like it's fine to just remove the old pref from AtomBrowserContext

@bridiver
Copy link
Collaborator

@sydneyli I took your commits and created a new PR to make a few changes #361

@bridiver bridiver closed this Oct 25, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[hackerone] webkitRelativePath may expose OS username "Folder Upload" feature in Google Drive Broken
3 participants