electron/shell/common/api/electron_api_clipboard_mac.mm

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
589 B
Text
Raw Normal View History

2016-10-24 08:13:34 +00: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"
#include "shell/common/api/electron_api_clipboard.h"
2016-10-24 08:13:34 +00:00
#include "ui/base/cocoa/find_pasteboard.h"
2022-06-29 19:55:47 +00:00
namespace electron::api {
2016-10-24 08:13:34 +00:00
void Clipboard::WriteFindText(const std::u16string& text) {
2016-10-24 08:13:34 +00:00
NSString* text_ns = base::SysUTF16ToNSString(text);
[[FindPasteboard sharedInstance] setFindText:text_ns];
}
std::u16string Clipboard::ReadFindText() {
2016-10-24 08:13:34 +00:00
return GetFindPboardText();
}
2022-06-29 19:55:47 +00:00
} // namespace electron::api