FileChooserDialog(GtkFileChooserAction action,
atom::NativeWindow* parent_window,
const std::string& title,
- const base::FilePath& default_path) {
+ const base::FilePath& default_path)
+ : dialog_scope_(new atom::NativeWindow::DialogScope(parent_window)) {
const char* confirm_text = GTK_STOCK_OK;
if (action == GTK_FILE_CHOOSER_ACTION_SAVE)
confirm_text = GTK_STOCK_SAVE;
SaveDialogCallback save_callback_;
OpenDialogCallback open_callback_;
+ scoped_ptr<atom::NativeWindow::DialogScope> dialog_scope_;
+
DISALLOW_COPY_AND_ASSIGN(FileChooserDialog);
};
const std::string& title,
const std::string& message,
const std::string& detail)
- : cancel_id_(0) {
+ : cancel_id_(0),
+ dialog_scope_(new NativeWindow::DialogScope(parent_window)) {
GtkWindow* window = parent_window ? parent_window->GetNativeWindow() : NULL;
dialog_ = gtk_dialog_new_with_buttons(
title.c_str(),
GtkWidget* dialog_;
MessageBoxCallback callback_;
+ scoped_ptr<NativeWindow::DialogScope> dialog_scope_;
+
// The id to return when the dialog is closed without pressing buttons.
int cancel_id_;