Skip to content

Commit

Permalink
Extend RefCounted and add private destructor
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinsawicki committed Feb 24, 2017
1 parent a33ffd6 commit 29f92bf
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions atom/browser/web_dialog_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@

namespace {

class FileSelectHelper : public base::RefCountedThreadSafe<
FileSelectHelper,
content::BrowserThread::DeleteOnUIThread>,
class FileSelectHelper : public base::RefCounted<FileSelectHelper>,
public content::WebContentsObserver {
public:
FileSelectHelper(content::RenderFrameHost* render_frame_host,
Expand All @@ -44,18 +42,20 @@ class FileSelectHelper : public base::RefCountedThreadSafe<
}

void ShowOpenDialog(const file_dialog::DialogSettings& settings) {
auto callback = base::Bind(&FileSelectHelper::OnOpenDialogDone,
base::Unretained(this));
auto callback = base::Bind(&FileSelectHelper::OnOpenDialogDone, this);
file_dialog::ShowOpenDialog(settings, callback);
}

void ShowSaveDialog(const file_dialog::DialogSettings& settings) {
auto callback = base::Bind(&FileSelectHelper::OnSaveDialogDone,
base::Unretained(this));
auto callback = base::Bind(&FileSelectHelper::OnSaveDialogDone, this);
file_dialog::ShowSaveDialog(settings, callback);
}

private:
friend class base::RefCounted<FileSelectHelper>;

~FileSelectHelper() {}

void OnOpenDialogDone(bool result, const std::vector<base::FilePath>& paths) {
std::vector<content::FileChooserFileInfo> file_info;
if (result) {
Expand Down

0 comments on commit 29f92bf

Please sign in to comment.