2016-10-24 17:13:34 +09:00
|
|
|
// Copyright (c) 2016 GitHub, Inc.
|
|
|
|
// Use of this source code is governed by the MIT license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
#include "base/strings/sys_string_conversions.h"
|
2020-02-04 12:19:40 -08:00
|
|
|
#include "shell/common/api/electron_api_clipboard.h"
|
2016-10-24 17:13:34 +09:00
|
|
|
#include "ui/base/cocoa/find_pasteboard.h"
|
|
|
|
|
2019-06-19 14:23:04 -07:00
|
|
|
namespace electron {
|
2016-10-24 17:13:34 +09:00
|
|
|
|
|
|
|
namespace api {
|
|
|
|
|
2021-03-16 12:18:45 -04:00
|
|
|
void Clipboard::WriteFindText(const std::u16string& text) {
|
2016-10-24 17:13:34 +09:00
|
|
|
NSString* text_ns = base::SysUTF16ToNSString(text);
|
|
|
|
[[FindPasteboard sharedInstance] setFindText:text_ns];
|
|
|
|
}
|
|
|
|
|
2021-03-16 12:18:45 -04:00
|
|
|
std::u16string Clipboard::ReadFindText() {
|
2016-10-24 17:13:34 +09:00
|
|
|
return GetFindPboardText();
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace api
|
|
|
|
|
2019-06-19 14:23:04 -07:00
|
|
|
} // namespace electron
|