New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use callback dialog methods in RunFileChooser #8745
Conversation
fcd0db9
to
aa38d2d
Compare
aa38d2d
to
527360f
Compare
527360f
to
469b951
Compare
atom/browser/web_dialog_helper.cc
Outdated
@@ -26,6 +28,94 @@ | |||
|
|||
namespace { | |||
|
|||
class FileSelectHelper : public base::RefCountedThreadSafe< |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be just base::RefCounted
, I don't see this class being used across threads. Also its good practice to make destructor private for ref counted classes.
atom/browser/web_dialog_helper.cc
Outdated
|
||
void ShowOpenDialog(const file_dialog::DialogSettings& settings) { | ||
auto callback = base::Bind(&FileSelectHelper::OnOpenDialogDone, | ||
base::Unretained(this)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its not necessary for unretained
wrapper since its ref counted, same with other bind call.
Thanks @deepak1556 for taking a look at this 👍 |
atom/browser/web_dialog_helper.cc
Outdated
@@ -16,7 +16,9 @@ | |||
#include "base/strings/utf_string_conversions.h" | |||
#include "chrome/common/pref_names.h" | |||
#include "components/prefs/pref_service.h" | |||
#include "content/public/browser/browser_thread.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor change, this header is not used.
186ad70
to
a62c2f9
Compare
7428b6a
to
ef085a1
Compare
This pull request switches the open and save dialogs opened in
WebDialogHelper::RunFileChooser
to be callback-based instead of synchronous.Inspired by https://cs.chromium.org/chromium/src/chrome/browser/file_select_helper.h
Closes #8457