Add clipboard.writeImage API
This commit is contained in:
parent
0bb7abd7a4
commit
6f082b630d
2 changed files with 7 additions and 0 deletions
|
@ -69,6 +69,11 @@ gfx::Image ReadImage(ui::ClipboardType type) {
|
|||
return gfx::Image::CreateFrom1xBitmap(bitmap);
|
||||
}
|
||||
|
||||
void WriteImage(const gfx::Image& image, ui::ClipboardType type) {
|
||||
ui::ScopedClipboardWriter writer(type);
|
||||
writer.WriteImage(image.AsBitmap());
|
||||
}
|
||||
|
||||
void Clear(ui::ClipboardType type) {
|
||||
ui::Clipboard::GetForCurrentThread()->Clear(type);
|
||||
}
|
||||
|
@ -81,6 +86,7 @@ void Initialize(v8::Handle<v8::Object> exports, v8::Handle<v8::Value> unused,
|
|||
dict.SetMethod("_readText", &ReadText);
|
||||
dict.SetMethod("_writeText", &WriteText);
|
||||
dict.SetMethod("_readImage", &ReadImage);
|
||||
dict.SetMethod("_writeImage", &WriteImage);
|
||||
dict.SetMethod("_clear", &Clear);
|
||||
}
|
||||
|
||||
|
|
|
@ -10,4 +10,5 @@ else
|
|||
readText: (type='standard') -> binding._readText type
|
||||
writeText: (text, type='standard') -> binding._writeText text, type
|
||||
readImage: (type='standard') -> binding._readImage type
|
||||
writeImage: (image, type='standard') -> binding._writeImage image, type
|
||||
clear: (type='standard') -> binding._clear type
|
||||
|
|
Loading…
Reference in a new issue