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
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions atom/browser/common_web_contents_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,7 @@ void CommonWebContentsDelegate::RunFileChooser(
void CommonWebContentsDelegate::EnumerateDirectory(content::WebContents* guest,
int request_id,
const base::FilePath& path) {
if (!web_dialog_helper_)
web_dialog_helper_.reset(new WebDialogHelper(owner_window()));
web_dialog_helper_->EnumerateDirectory(guest, request_id, path);
FileSelectHelper::EnumerateDirectory(guest, request_id, path);
}

void CommonWebContentsDelegate::EnterFullscreenModeForTab(
Expand Down
2 changes: 0 additions & 2 deletions atom/browser/common_web_contents_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ namespace atom {

class AtomBrowserContext;
class NativeWindow;
class WebDialogHelper;

class CommonWebContentsDelegate
: public content::WebContentsDelegate,
Expand Down Expand Up @@ -144,7 +143,6 @@ class CommonWebContentsDelegate
// Whether window is fullscreened by window api.
bool native_fullscreen_;

std::unique_ptr<WebDialogHelper> web_dialog_helper_;
scoped_refptr<DevToolsFileSystemIndexer> devtools_file_system_indexer_;

// Make sure BrowserContext is alwasys destroyed after WebContents.
Expand Down
4 changes: 2 additions & 2 deletions patches/master_patch.patch
Original file line number Diff line number Diff line change
Expand Up @@ -511,14 +511,14 @@ index 7acc7baa7cd01b9627e8d231a3a7848cf4ec2295..e857daff2ba3910223f1039f66364faa
// web_contents_id, and returns the WebContents index and the TabStripModel.
int FindTabStripModelById(int64_t target_web_contents_id,
diff --git a/chrome/browser/ui/chrome_select_file_policy.cc b/chrome/browser/ui/chrome_select_file_policy.cc
index 43dd8ee370f089af922b387fc57baa4183d9540a..d033fe58b08c52f888d9e42b9334029dd1481876 100644
index 43dd8ee370f089af922b387fc57baa4183d9540a..c1392ba4beb20bc96c656cf5e6880e22e03348a2 100644
--- 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

SimpleAlertInfoBarDelegate::Create(
InfoBarService::FromWebContents(source_contents_),
infobars::InfoBarDelegate::CHROME_SELECT_FILE_POLICY, nullptr,
Expand Down