Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
0d446703
E
engine
项目概览
sxychenjing
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
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,发现更多精彩内容 >>
提交
0d446703
编写于
1月 27, 2016
作者:
C
Chinmay Garde
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
iOS: Implementation of ::activity::Activity from activity.mojom
上级
4907b642
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
254 addition
and
19 deletion
+254
-19
build/config/ios/rules.gni
build/config/ios/rules.gni
+3
-2
sky/build/sdk_xcode_harness/Runner/Info.plist
sky/build/sdk_xcode_harness/Runner/Info.plist
+2
-0
sky/build/sky_precompilation_sdk.gni
sky/build/sky_precompilation_sdk.gni
+3
-2
sky/services/activity/BUILD.gn
sky/services/activity/BUILD.gn
+4
-0
sky/services/activity/ios/activity_impl.h
sky/services/activity/ios/activity_impl.h
+54
-0
sky/services/activity/ios/activity_impl.mm
sky/services/activity/ios/activity_impl.mm
+83
-0
sky/services/activity/ios/path_service_impl.h
sky/services/activity/ios/path_service_impl.h
+5
-5
sky/services/activity/ios/path_service_impl.mm
sky/services/activity/ios/path_service_impl.mm
+2
-2
sky/services/activity/ios/user_feedback_impl.h
sky/services/activity/ios/user_feedback_impl.h
+38
-0
sky/services/activity/ios/user_feedback_impl.mm
sky/services/activity/ios/user_feedback_impl.mm
+38
-0
sky/shell/platform/ios/sky_surface.mm
sky/shell/platform/ios/sky_surface.mm
+10
-0
sky/shell/platform/mac/platform_service_provider.cc
sky/shell/platform/mac/platform_service_provider.cc
+10
-8
sky/shell/platform/mac/platform_service_provider.h
sky/shell/platform/mac/platform_service_provider.h
+2
-0
未找到文件。
build/config/ios/rules.gni
浏览文件 @
0d446703
...
...
@@ -146,10 +146,11 @@ template("ios_app") {
executable(bin_gen_target_name) {
libs = [
"
UIKit
.framework",
"
AudioToolbox
.framework",
"AVFoundation.framework",
"OpenGLES.framework",
"QuartzCore.framework",
"
OpenGLES.framework"
"
UIKit.framework",
]
deps = invoker.deps
output_name = app_name
...
...
sky/build/sdk_xcode_harness/Runner/Info.plist
浏览文件 @
0d446703
...
...
@@ -22,6 +22,8 @@
<string>
1
</string>
<key>
LSRequiresIPhoneOS
</key>
<true/>
<key>
UIViewControllerBasedStatusBarAppearance
</key>
<false/>
<key>
UILaunchStoryboardName
</key>
<string>
LaunchScreen
</string>
<key>
UIRequiredDeviceCapabilities
</key>
...
...
sky/build/sky_precompilation_sdk.gni
浏览文件 @
0d446703
...
...
@@ -75,10 +75,11 @@ template("sky_precompilation_sdk") {
executable_gen_target_name = target_name + "_runner"
executable(executable_gen_target_name) {
libs = [
"
UIKit
.framework",
"
AudioToolbox
.framework",
"AVFoundation.framework",
"QuartzCore.framework",
"OpenGLES.framework",
"QuartzCore.framework",
"UIKit.framework",
]
deps = [ "//sky/shell:ios_scaffolding" ]
}
...
...
sky/services/activity/BUILD.gn
浏览文件 @
0d446703
...
...
@@ -43,8 +43,12 @@ if (is_android) {
if (is_ios) {
source_set("activity_lib") {
sources = [
"ios/activity_impl.h",
"ios/activity_impl.mm",
"ios/path_service_impl.h",
"ios/path_service_impl.mm",
"ios/user_feedback_impl.h",
"ios/user_feedback_impl.mm",
]
deps = [
"//base:base",
...
...
sky/services/activity/ios/activity_impl.h
0 → 100644
浏览文件 @
0d446703
// 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 SKY_SERVICES_ACTIVITY_IOS_ACTIVITY_IMPL_H_
#define SKY_SERVICES_ACTIVITY_IOS_ACTIVITY_IMPL_H_
#include "base/macros.h"
#include "mojo/public/cpp/application/interface_factory.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
#include "sky/services/activity/activity.mojom.h"
namespace
sky
{
namespace
services
{
namespace
activity
{
class
ActivityImpl
:
public
::
activity
::
Activity
{
public:
explicit
ActivityImpl
(
mojo
::
InterfaceRequest
<::
activity
::
Activity
>
request
);
~
ActivityImpl
()
override
;
void
GetUserFeedback
(
mojo
::
InterfaceRequest
<::
activity
::
UserFeedback
>
user_feedback
)
override
;
void
StartActivity
(
::
activity
::
IntentPtr
intent
)
override
;
void
FinishCurrentActivity
()
override
;
void
SetTaskDescription
(
::
activity
::
TaskDescriptionPtr
description
)
override
;
void
SetSystemUIVisibility
(
::
activity
::
SystemUiVisibility
visibility
)
override
;
void
SetRequestedOrientation
(
::
activity
::
ScreenOrientation
orientation
)
override
;
private:
mojo
::
StrongBinding
<::
activity
::
Activity
>
binding_
;
DISALLOW_COPY_AND_ASSIGN
(
ActivityImpl
);
};
class
ActivityFactory
:
public
mojo
::
InterfaceFactory
<::
activity
::
Activity
>
{
public:
void
Create
(
mojo
::
ApplicationConnection
*
connection
,
mojo
::
InterfaceRequest
<::
activity
::
Activity
>
request
)
override
;
};
}
// namespace activity
}
// namespace services
}
// namespace sky
#endif // SKY_SERVICES_ACTIVITY_IOS_ACTIVITY_IMPL_H_
sky/services/activity/ios/activity_impl.mm
0 → 100644
浏览文件 @
0d446703
// 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 "base/logging.h"
#include "base/mac/scoped_nsautorelease_pool.h"
#include "sky/services/activity/ios/activity_impl.h"
#include "sky/services/activity/ios/user_feedback_impl.h"
#include <UIKit/UIKit.h>
namespace
sky
{
namespace
services
{
namespace
activity
{
ActivityImpl
::
ActivityImpl
(
mojo
::
InterfaceRequest
<::
activity
::
Activity
>
request
)
:
binding_
(
this
,
request
.
Pass
())
{}
ActivityImpl
::~
ActivityImpl
()
{}
void
ActivityImpl
::
GetUserFeedback
(
mojo
::
InterfaceRequest
<::
activity
::
UserFeedback
>
request
)
{
new
UserFeedbackImpl
(
request
.
Pass
());
}
void
ActivityImpl
::
StartActivity
(
::
activity
::
IntentPtr
intent
)
{
CHECK
(
false
)
<<
"Cannot start activities on iOS"
;
}
void
ActivityImpl
::
FinishCurrentActivity
()
{
CHECK
(
false
)
<<
"Cannot finish activities on iOS"
;
}
void
ActivityImpl
::
SetTaskDescription
(
::
activity
::
TaskDescriptionPtr
description
)
{
// No counterpart on iOS but is a benign operation. So no asserts.
}
void
ActivityImpl
::
SetSystemUIVisibility
(
::
activity
::
SystemUiVisibility
visibility
)
{
using
Visibility
=
::
activity
::
SystemUiVisibility
;
bool
visible
=
true
;
switch
(
visibility
)
{
case
Visibility
::
STANDARD
:
visible
=
true
;
break
;
case
Visibility
::
IMMERSIVE
:
// There is no difference between fullscreen and immersive on iOS
case
Visibility
::
FULLSCREEN
:
visible
=
false
;
break
;
}
base
::
mac
::
ScopedNSAutoreleasePool
pool
;
// We opt out of view controller based status bar visibility since we want
// to be able to modify this on the fly. The key used is
// UIViewControllerBasedStatusBarAppearance
[
UIApplication
sharedApplication
].
statusBarHidden
=
!
visible
;
}
void
ActivityImpl
::
SetRequestedOrientation
(
::
activity
::
ScreenOrientation
orientation
)
{
base
::
mac
::
ScopedNSAutoreleasePool
pool
;
// TODO: This needs to be wired up to communicate with the root view
// controller in the embedder. The current implementation is a stopgap
// measure
[[
UIDevice
currentDevice
]
setValue:
[
NSNumber
numberWithInteger
:
UIInterfaceOrientationPortrait
]
forKey:
@"orientation"
];
}
void
ActivityFactory
::
Create
(
mojo
::
ApplicationConnection
*
connection
,
mojo
::
InterfaceRequest
<::
activity
::
Activity
>
request
)
{
new
ActivityImpl
(
request
.
Pass
());
}
}
// namespace activity
}
// namespace services
}
// namespace sky
sky/services/activity/ios/path_service_impl.h
浏览文件 @
0d446703
...
...
@@ -14,10 +14,10 @@ namespace sky {
namespace
services
{
namespace
path
{
class
PathServiceImpl
:
public
activity
::
PathService
{
class
PathServiceImpl
:
public
::
activity
::
PathService
{
public:
explicit
PathServiceImpl
(
mojo
::
InterfaceRequest
<
activity
::
PathService
>
request
);
mojo
::
InterfaceRequest
<
::
activity
::
PathService
>
request
);
~
PathServiceImpl
()
override
;
void
GetAppDataDir
(
const
GetAppDataDirCallback
&
callback
)
override
;
...
...
@@ -25,16 +25,16 @@ class PathServiceImpl : public activity::PathService {
void
GetCacheDir
(
const
GetCacheDirCallback
&
callback
)
override
;
private:
mojo
::
StrongBinding
<
activity
::
PathService
>
binding_
;
mojo
::
StrongBinding
<
::
activity
::
PathService
>
binding_
;
DISALLOW_COPY_AND_ASSIGN
(
PathServiceImpl
);
};
class
PathServiceFactory
:
public
mojo
::
InterfaceFactory
<
activity
::
PathService
>
{
:
public
mojo
::
InterfaceFactory
<
::
activity
::
PathService
>
{
public:
void
Create
(
mojo
::
ApplicationConnection
*
connection
,
mojo
::
InterfaceRequest
<
activity
::
PathService
>
request
)
override
;
mojo
::
InterfaceRequest
<
::
activity
::
PathService
>
request
)
override
;
};
}
// namespace path
...
...
sky/services/activity/ios/path_service_impl.mm
浏览文件 @
0d446703
...
...
@@ -12,7 +12,7 @@ namespace services {
namespace
path
{
PathServiceImpl
::
PathServiceImpl
(
mojo
::
InterfaceRequest
<
activity
::
PathService
>
request
)
mojo
::
InterfaceRequest
<
::
activity
::
PathService
>
request
)
:
binding_
(
this
,
request
.
Pass
())
{}
PathServiceImpl
::~
PathServiceImpl
()
{}
...
...
@@ -49,7 +49,7 @@ void PathServiceImpl::GetCacheDir(const GetCacheDirCallback& callback) {
void
PathServiceFactory
::
Create
(
mojo
::
ApplicationConnection
*
connection
,
mojo
::
InterfaceRequest
<
activity
::
PathService
>
request
)
{
mojo
::
InterfaceRequest
<
::
activity
::
PathService
>
request
)
{
new
PathServiceImpl
(
request
.
Pass
());
}
...
...
sky/services/activity/ios/user_feedback_impl.h
0 → 100644
浏览文件 @
0d446703
// 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 SKY_SERVICES_ACTIVITY_IOS_USER_FEEDBACK_IMPL_H_
#define SKY_SERVICES_ACTIVITY_IOS_USER_FEEDBACK_IMPL_H_
#include "base/macros.h"
#include "mojo/public/cpp/application/interface_factory.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
#include "sky/services/activity/activity.mojom.h"
namespace
sky
{
namespace
services
{
namespace
activity
{
class
UserFeedbackImpl
:
public
::
activity
::
UserFeedback
{
public:
explicit
UserFeedbackImpl
(
mojo
::
InterfaceRequest
<::
activity
::
UserFeedback
>
request
);
~
UserFeedbackImpl
()
override
;
void
PerformHapticFeedback
(
::
activity
::
HapticFeedbackType
type
)
override
;
void
PerformAuralFeedback
(
::
activity
::
AuralFeedbackType
type
)
override
;
private:
mojo
::
StrongBinding
<::
activity
::
UserFeedback
>
binding_
;
DISALLOW_COPY_AND_ASSIGN
(
UserFeedbackImpl
);
};
}
// namespace activity
}
// namespace services
}
// namespace sky
#endif // SKY_SERVICES_ACTIVITY_IOS_USER_FEEDBACK_IMPL_H_
sky/services/activity/ios/user_feedback_impl.mm
0 → 100644
浏览文件 @
0d446703
// 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 "base/logging.h"
#include "base/mac/scoped_nsautorelease_pool.h"
#include "sky/services/activity/ios/user_feedback_impl.h"
#include <AudioToolbox/AudioToolbox.h>
#include <UIKit/UIKit.h>
namespace
sky
{
namespace
services
{
namespace
activity
{
UserFeedbackImpl
::
UserFeedbackImpl
(
mojo
::
InterfaceRequest
<::
activity
::
UserFeedback
>
request
)
:
binding_
(
this
,
request
.
Pass
())
{}
UserFeedbackImpl
::~
UserFeedbackImpl
()
{}
void
UserFeedbackImpl
::
PerformHapticFeedback
(
::
activity
::
HapticFeedbackType
type
)
{
// All feedback types are specific to Android and are treated as equal on iOS
AudioServicesPlayAlertSound
(
kSystemSoundID_Vibrate
);
}
void
UserFeedbackImpl
::
PerformAuralFeedback
(
::
activity
::
AuralFeedbackType
type
)
{
base
::
mac
::
ScopedNSAutoreleasePool
pool
;
// All feedback types are specific to Android and are treated as equal on iOS
// The surface must (and does) adopt the UIInputViewAudioFeedback protocol
[[
UIDevice
currentDevice
]
playInputClick
];
}
}
// namespace activity
}
// namespace services
}
// namespace sky
sky/shell/platform/ios/sky_surface.mm
浏览文件 @
0d446703
...
...
@@ -86,6 +86,10 @@ class TouchMapper {
std
::
map
<
uintptr_t
,
int
>
touch_map_
;
};
@interface
SkySurface
()
<
UIInputViewAudioFeedback
>
@end
@implementation
SkySurface
{
BOOL
_platformViewInitialized
;
CGPoint
_lastScrollTranslation
;
...
...
@@ -289,6 +293,12 @@ static std::string TracesBasePath() {
[
self
dispatchTouches
:
touches
phase
:
UITouchPhaseCancelled
];
}
#pragma mark - Input Clicks
-
(
BOOL
)
enableInputClicksWhenVisible
{
return
YES
;
}
#pragma mark - Misc.
+
(
Class
)
layerClass
{
...
...
sky/shell/platform/mac/platform_service_provider.cc
浏览文件 @
0d446703
...
...
@@ -9,18 +9,16 @@ namespace shell {
PlatformServiceProvider
::
PlatformServiceProvider
(
mojo
::
InterfaceRequest
<
mojo
::
ServiceProvider
>
request
)
:
binding_
(
this
,
request
.
Pass
())
{
}
:
binding_
(
this
,
request
.
Pass
())
{}
PlatformServiceProvider
::~
PlatformServiceProvider
()
{
}
PlatformServiceProvider
::~
PlatformServiceProvider
()
{}
void
PlatformServiceProvider
::
ConnectToService
(
const
mojo
::
String
&
service_name
,
mojo
::
ScopedMessagePipeHandle
client_handle
)
{
if
(
service_name
==
mojo
::
NetworkService
::
Name_
)
{
network_
.
Create
(
nullptr
,
mojo
::
MakeRequest
<
mojo
::
NetworkService
>
(
client_handle
.
Pass
()));
network_
.
Create
(
nullptr
,
mojo
::
MakeRequest
<
mojo
::
NetworkService
>
(
client_handle
.
Pass
()));
}
#if TARGET_OS_IPHONE
if
(
service_name
==
::
keyboard
::
KeyboardService
::
Name_
)
{
...
...
@@ -28,8 +26,8 @@ void PlatformServiceProvider::ConnectToService(
client_handle
.
Pass
()));
}
if
(
service_name
==
::
media
::
MediaPlayer
::
Name_
)
{
media_player_
.
Create
(
nullptr
,
mojo
::
MakeRequest
<::
media
::
MediaPlayer
>
(
client_handle
.
Pass
()));
media_player_
.
Create
(
nullptr
,
mojo
::
MakeRequest
<::
media
::
MediaPlayer
>
(
client_handle
.
Pass
()));
}
if
(
service_name
==
::
media
::
MediaService
::
Name_
)
{
media_service_
.
Create
(
nullptr
,
mojo
::
MakeRequest
<::
media
::
MediaService
>
(
...
...
@@ -43,6 +41,10 @@ void PlatformServiceProvider::ConnectToService(
path_
.
Create
(
nullptr
,
mojo
::
MakeRequest
<::
activity
::
PathService
>
(
client_handle
.
Pass
()));
}
if
(
service_name
==
::
activity
::
Activity
::
Name_
)
{
activity_
.
Create
(
nullptr
,
mojo
::
MakeRequest
<::
activity
::
Activity
>
(
client_handle
.
Pass
()));
}
#endif
}
...
...
sky/shell/platform/mac/platform_service_provider.h
浏览文件 @
0d446703
...
...
@@ -10,6 +10,7 @@
#include "sky/services/ns_net/network_service_impl.h"
#if TARGET_OS_IPHONE
#include "sky/services/activity/ios/activity_impl.h"
#include "sky/services/activity/ios/path_service_impl.h"
#include "sky/services/keyboard/ios/keyboard_service_impl.h"
#include "sky/services/media/ios/media_player_impl.h"
...
...
@@ -36,6 +37,7 @@ class PlatformServiceProvider : public mojo::ServiceProvider {
mojo
::
StrongBinding
<
mojo
::
ServiceProvider
>
binding_
;
mojo
::
NetworkServiceFactory
network_
;
#if TARGET_OS_IPHONE
sky
::
services
::
activity
::
ActivityFactory
activity_
;
sky
::
services
::
keyboard
::
KeyboardServiceFactory
keyboard_
;
sky
::
services
::
media
::
MediaPlayerFactory
media_player_
;
sky
::
services
::
media
::
MediaServiceFactory
media_service_
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录