Skip to content

Commit

Permalink
refactor: remove redundant reference
Browse files Browse the repository at this point in the history
  • Loading branch information
hamirmahal committed Oct 18, 2024
1 parent adb2959 commit dfa6a3f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions browser/ui/browser_commands.cc
Original file line number Diff line number Diff line change
Expand Up @@ -907,8 +907,6 @@ namespace {

class BookmarksExportListener : public ui::SelectFileDialog::Listener {
public:
scoped_refptr<ui::SelectFileDialog> fileSelector;

explicit BookmarksExportListener(Profile* profile) : profile_(profile) {}
void FileSelected(const ui::SelectedFileInfo& file, int index) override {
bookmark_html_writer::WriteBookmarks(profile_, file.file_path, nullptr);
Expand Down Expand Up @@ -936,8 +934,10 @@ void ExportAllBookmarks(Browser* browser) {
BookmarksExportListener* listener =
new BookmarksExportListener(browser->profile());

listener->fileSelector = ui::SelectFileDialog::Create(listener, nullptr);
listener->fileSelector->SelectFile(
scoped_refptr<ui::SelectFileDialog> file_selector =
ui::SelectFileDialog::Create(listener, nullptr);

file_selector->SelectFile(
ui::SelectFileDialog::SELECT_SAVEAS_FILE,
l10n_util::GetStringUTF16(IDS_BOOKMARK_MANAGER_MENU_EXPORT),
base::FilePath::FromUTF8Unsafe(defaultBookmarksFilename), &file_types, 1,
Expand Down

0 comments on commit dfa6a3f

Please sign in to comment.