run clang-format
This commit is contained in:
parent
a19ddfc578
commit
354f872919
1 changed files with 13 additions and 9 deletions
|
@ -52,8 +52,8 @@ std::string Clipboard::Read(const std::string& format_string) {
|
|||
v8::Local<v8::Value> Clipboard::ReadBuffer(const std::string& format_string,
|
||||
mate::Arguments* args) {
|
||||
std::string data = Read(format_string);
|
||||
return node::Buffer::Copy(
|
||||
args->isolate(), data.data(), data.length()).ToLocalChecked();
|
||||
return node::Buffer::Copy(args->isolate(), data.data(), data.length())
|
||||
.ToLocalChecked();
|
||||
}
|
||||
|
||||
void Clipboard::WriteBuffer(const std::string& format,
|
||||
|
@ -97,11 +97,11 @@ base::string16 Clipboard::ReadText(mate::Arguments* args) {
|
|||
base::string16 data;
|
||||
ui::Clipboard* clipboard = ui::Clipboard::GetForCurrentThread();
|
||||
auto type = GetClipboardType(args);
|
||||
if (clipboard->IsFormatAvailable(
|
||||
ui::Clipboard::GetPlainTextWFormatType(), type)) {
|
||||
if (clipboard->IsFormatAvailable(ui::Clipboard::GetPlainTextWFormatType(),
|
||||
type)) {
|
||||
clipboard->ReadText(type, &data);
|
||||
} else if (clipboard->IsFormatAvailable(
|
||||
ui::Clipboard::GetPlainTextFormatType(), type)) {
|
||||
ui::Clipboard::GetPlainTextFormatType(), type)) {
|
||||
std::string result;
|
||||
clipboard->ReadAsciiText(type, &result);
|
||||
data = base::ASCIIToUTF16(result);
|
||||
|
@ -173,14 +173,16 @@ void Clipboard::WriteImage(const gfx::Image& image, mate::Arguments* args) {
|
|||
SkBitmap bmp;
|
||||
|
||||
if (bmp.tryAllocPixels(orig.info()) &&
|
||||
orig.readPixels(bmp.info(), bmp.getPixels(), bmp.rowBytes(), 0, 0)) {
|
||||
orig.readPixels(bmp.info(), bmp.getPixels(), bmp.rowBytes(), 0, 0)) {
|
||||
writer.WriteImage(bmp);
|
||||
}
|
||||
}
|
||||
|
||||
#if !defined(OS_MACOSX)
|
||||
void Clipboard::WriteFindText(const base::string16& text) {}
|
||||
base::string16 Clipboard::ReadFindText() { return base::string16(); }
|
||||
base::string16 Clipboard::ReadFindText() {
|
||||
return base::string16();
|
||||
}
|
||||
#endif
|
||||
|
||||
void Clipboard::Clear(mate::Arguments* args) {
|
||||
|
@ -193,8 +195,10 @@ void Clipboard::Clear(mate::Arguments* args) {
|
|||
|
||||
namespace {
|
||||
|
||||
void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
|
||||
v8::Local<v8::Context> context, void* priv) {
|
||||
void Initialize(v8::Local<v8::Object> exports,
|
||||
v8::Local<v8::Value> unused,
|
||||
v8::Local<v8::Context> context,
|
||||
void* priv) {
|
||||
mate::Dictionary dict(context->GetIsolate(), exports);
|
||||
dict.SetMethod("availableFormats", &atom::api::Clipboard::AvailableFormats);
|
||||
dict.SetMethod("has", &atom::api::Clipboard::Has);
|
||||
|
|
Loading…
Reference in a new issue