Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_43355755
engine
提交
808009d4
E
engine
项目概览
weixin_43355755
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
808009d4
编写于
10月 18, 2016
作者:
A
Adam Barth
提交者:
GitHub
10月 18, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove clipboard mojo service (#3143)
All the clients have migrated to platform messages.
上级
be976126
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
0 addition
and
168 deletion
+0
-168
services/editing/BUILD.gn
services/editing/BUILD.gn
+0
-3
services/editing/ios/clipboard_impl.h
services/editing/ios/clipboard_impl.h
+0
-35
services/editing/ios/clipboard_impl.mm
services/editing/ios/clipboard_impl.mm
+0
-51
services/editing/src/org/domokit/editing/ClipboardImpl.java
services/editing/src/org/domokit/editing/ClipboardImpl.java
+0
-64
shell/platform/android/io/flutter/view/FlutterMain.java
shell/platform/android/io/flutter/view/FlutterMain.java
+0
-9
shell/platform/darwin/common/platform_service_provider.cc
shell/platform/darwin/common/platform_service_provider.cc
+0
-6
未找到文件。
services/editing/BUILD.gn
浏览文件 @
808009d4
...
...
@@ -26,7 +26,6 @@ if (is_android) {
android_library("editing_lib") {
java_files = [
"src/org/domokit/editing/ClipboardImpl.java",
"src/org/domokit/editing/KeyboardImpl.java",
"src/org/domokit/editing/KeyboardViewState.java",
"src/org/domokit/editing/InputConnectionAdaptor.java",
...
...
@@ -46,8 +45,6 @@ if (is_ios) {
sources = [
"ios/keyboard_impl.h",
"ios/keyboard_impl.mm",
"ios/clipboard_impl.h",
"ios/clipboard_impl.mm",
]
deps = [
"//base:base",
...
...
services/editing/ios/clipboard_impl.h
已删除
100644 → 0
浏览文件 @
be976126
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_SERVICES_CLIPBOARD_IOS_CLIPBOARD_SERVICE_IMPL_H_
#define FLUTTER_SERVICES_CLIPBOARD_IOS_CLIPBOARD_SERVICE_IMPL_H_
#include "base/macros.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
#include "flutter/services/editing/editing.mojom.h"
namespace
sky
{
namespace
services
{
namespace
editing
{
class
ClipboardImpl
:
public
::
editing
::
Clipboard
{
public:
explicit
ClipboardImpl
(
mojo
::
InterfaceRequest
<::
editing
::
Clipboard
>
request
);
~
ClipboardImpl
()
override
;
void
SetClipboardData
(
::
editing
::
ClipboardDataPtr
clip
)
override
;
void
GetClipboardData
(
const
mojo
::
String
&
format
,
const
::
editing
::
Clipboard
::
GetClipboardDataCallback
&
callback
)
override
;
private:
mojo
::
StrongBinding
<::
editing
::
Clipboard
>
binding_
;
DISALLOW_COPY_AND_ASSIGN
(
ClipboardImpl
);
};
}
// namespace editing
}
// namespace services
}
// namespace sky
#endif
/* defined(FLUTTER_SERVICES_CLIPBOARD_IOS_CLIPBOARD_SERVICE_IMPL_H__) */
services/editing/ios/clipboard_impl.mm
已删除
100644 → 0
浏览文件 @
be976126
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "flutter/services/editing/ios/clipboard_impl.h"
#include "base/logging.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include <UIKit/UIKit.h>
#include <unicode/utf16.h>
namespace
{
static
const
char
kTextPlainFormat
[]
=
"text/plain"
;
}
// namespace
namespace
sky
{
namespace
services
{
namespace
editing
{
ClipboardImpl
::
ClipboardImpl
(
mojo
::
InterfaceRequest
<::
editing
::
Clipboard
>
request
)
:
binding_
(
this
,
request
.
Pass
())
{}
ClipboardImpl
::~
ClipboardImpl
()
{
}
void
ClipboardImpl
::
SetClipboardData
(
::
editing
::
ClipboardDataPtr
clip
)
{
UIPasteboard
*
pasteboard
=
[
UIPasteboard
generalPasteboard
];
pasteboard
.
string
=
@
(
clip
->
text
.
data
());
}
void
ClipboardImpl
::
GetClipboardData
(
const
mojo
::
String
&
format
,
const
::
editing
::
Clipboard
::
GetClipboardDataCallback
&
callback
)
{
::
editing
::
ClipboardDataPtr
clip
;
UIPasteboard
*
pasteboard
=
[
UIPasteboard
generalPasteboard
];
if
((
format
.
is_null
()
||
format
==
kTextPlainFormat
)
&&
pasteboard
.
string
)
{
clip
=
::
editing
::
ClipboardData
::
New
();
clip
->
text
=
pasteboard
.
string
.
UTF8String
;
}
callback
.
Run
(
clip
.
Pass
());
}
}
// namespace editing
}
// namespace services
}
// namespace sky
services/editing/src/org/domokit/editing/ClipboardImpl.java
已删除
100644 → 0
浏览文件 @
be976126
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package
org.domokit.editing
;
import
android.content.ClipboardManager
;
import
android.content.ClipData
;
import
android.content.ClipDescription
;
import
android.content.Context
;
import
android.view.inputmethod.InputMethodManager
;
import
org.chromium.mojo.system.MojoException
;
import
org.chromium.mojom.editing.ClipboardData
;
import
org.chromium.mojom.editing.Clipboard
;
/**
* Android implementation of Clipboard.
*/
public
class
ClipboardImpl
implements
Clipboard
{
private
Context
mContext
;
private
static
final
String
kTextPlainFormat
=
"text/plain"
;
public
ClipboardImpl
(
Context
context
)
{
mContext
=
context
;
}
@Override
public
void
close
()
{
}
@Override
public
void
onConnectionError
(
MojoException
e
)
{}
@Override
public
void
setClipboardData
(
ClipboardData
incomingClip
)
{
ClipboardManager
clipboard
=
(
ClipboardManager
)
mContext
.
getSystemService
(
Context
.
CLIPBOARD_SERVICE
);
ClipData
clip
=
ClipData
.
newPlainText
(
"text label?"
,
incomingClip
.
text
);
clipboard
.
setPrimaryClip
(
clip
);
}
@Override
public
void
getClipboardData
(
String
format
,
GetClipboardDataResponse
callback
)
{
ClipboardManager
clipboard
=
(
ClipboardManager
)
mContext
.
getSystemService
(
Context
.
CLIPBOARD_SERVICE
);
ClipData
clip
=
clipboard
.
getPrimaryClip
();
if
(
clip
==
null
)
{
callback
.
call
(
null
);
return
;
}
if
((
format
==
null
||
format
.
equals
(
kTextPlainFormat
))
&&
clip
.
getDescription
().
hasMimeType
(
ClipDescription
.
MIMETYPE_TEXT_PLAIN
))
{
ClipboardData
clipResult
=
new
ClipboardData
();
clipResult
.
text
=
clip
.
getItemAt
(
0
).
getText
().
toString
();
callback
.
call
(
clipResult
);
return
;
}
// Unsupported or incompatible format.
callback
.
call
(
null
);
}
}
shell/platform/android/io/flutter/view/FlutterMain.java
浏览文件 @
808009d4
...
...
@@ -34,9 +34,7 @@ import org.chromium.mojo.bindings.Interface.Binding;
import
org.chromium.mojo.system.Core
;
import
org.chromium.mojo.system.impl.CoreImpl
;
import
org.chromium.mojo.system.MessagePipeHandle
;
import
org.chromium.mojom.editing.Clipboard
;
import
org.chromium.mojom.vsync.VSyncProvider
;
import
org.domokit.editing.ClipboardImpl
;
import
org.domokit.vsync.VSyncProviderImpl
;
/**
...
...
@@ -182,13 +180,6 @@ public class FlutterMain {
private
static
native
void
nativeRecordStartTimestamp
(
long
initTimeMillis
);
private
static
void
onServiceRegistryAvailable
(
final
Context
applicationContext
,
ServiceRegistry
registry
)
{
registry
.
register
(
Clipboard
.
MANAGER
.
getName
(),
new
ServiceFactory
()
{
@Override
public
Binding
connectToService
(
FlutterView
view
,
Core
core
,
MessagePipeHandle
pipe
)
{
return
Clipboard
.
MANAGER
.
bind
(
new
ClipboardImpl
(
view
.
getContext
()),
pipe
);
}
});
registry
.
register
(
VSyncProvider
.
MANAGER
.
getName
(),
new
ServiceFactory
()
{
@Override
public
Binding
connectToService
(
FlutterView
view
,
Core
core
,
MessagePipeHandle
pipe
)
{
...
...
shell/platform/darwin/common/platform_service_provider.cc
浏览文件 @
808009d4
...
...
@@ -5,7 +5,6 @@
#include "flutter/shell/platform/darwin/common/platform_service_provider.h"
#if TARGET_OS_IPHONE
#include "flutter/services/editing/ios/clipboard_impl.h"
#include "flutter/services/vsync/ios/vsync_provider_ios_impl.h"
#else
#include "flutter/services/vsync/mac/vsync_provider_mac_impl.h"
...
...
@@ -23,11 +22,6 @@ void PlatformServiceProvider::ConnectToService(
const
mojo
::
String
&
service_name
,
mojo
::
ScopedMessagePipeHandle
client_handle
)
{
#if TARGET_OS_IPHONE
if
(
service_name
==
::
editing
::
Clipboard
::
Name_
)
{
new
sky
::
services
::
editing
::
ClipboardImpl
(
mojo
::
InterfaceRequest
<::
editing
::
Clipboard
>
(
client_handle
.
Pass
()));
return
;
}
if
(
service_name
==
::
vsync
::
VSyncProvider
::
Name_
)
{
new
sky
::
services
::
vsync
::
VsyncProviderIOSImpl
(
mojo
::
InterfaceRequest
<::
vsync
::
VSyncProvider
>
(
client_handle
.
Pass
()));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录