Rewrite dialog API with our simpler blocking dialog implementations.

Fixed #9, fixed #10.
This commit is contained in:
Cheng Zhao 2013-05-20 21:46:43 +08:00
parent d19e62d867
commit 2bb33d8b32
6 changed files with 216 additions and 217 deletions

38
browser/file_dialog.h Normal file
View file

@ -0,0 +1,38 @@
// Copyright (c) 2013 GitHub, Inc. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef BROWSER_FILE_DIALOG_H_
#define BROWSER_FILE_DIALOG_H_
#include <string>
#include <vector>
#include "base/files/file_path.h"
namespace atom {
class NativeWindow;
}
namespace file_dialog {
enum FileDialogProperty {
FILE_DIALOG_OPEN_FILE = 1,
FILE_DIALOG_OPEN_DIRECTORY = 2,
FILE_DIALOG_MULTI_SELECTIONS = 4,
FILE_DIALOG_CREATE_DIRECTORY = 8,
};
bool ShowOpenDialog(const std::string& title,
const base::FilePath& default_path,
int properties,
std::vector<base::FilePath>* paths);
bool ShowSaveDialog(atom::NativeWindow* window,
const std::string& title,
const base::FilePath& default_path,
base::FilePath* path);
} // namespace file_dialog
#endif // BROWSER_FILE_DIALOG_H_