Route prepared file saves through platform services
This commit is contained in:
@@ -202,6 +202,29 @@ public:
|
||||
});
|
||||
#else
|
||||
(void)value;
|
||||
#endif
|
||||
}
|
||||
|
||||
void save_prepared_file(
|
||||
std::string_view path,
|
||||
std::string_view suggested_name,
|
||||
pp::platform::PreparedFileCallback callback) override
|
||||
{
|
||||
const std::string value(path);
|
||||
const std::string name(suggested_name);
|
||||
#ifdef __IOS__
|
||||
(void)name;
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[App::I->ios_view pick_file_save:value];
|
||||
});
|
||||
callback(value, true);
|
||||
#elif __WEB__
|
||||
webgl_pick_file_save(value, name, [callback = std::move(callback), value](bool success) {
|
||||
callback(value, success);
|
||||
});
|
||||
#else
|
||||
(void)name;
|
||||
callback(value, false);
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user