Merge lp:~abreu-alexandre/oxide/vibrate into lp:~oxide-developers/oxide/oxide.trunk
- vibrate
- Merge into oxide.trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 1350 | ||||
Proposed branch: | lp:~abreu-alexandre/oxide/vibrate | ||||
Merge into: | lp:~oxide-developers/oxide/oxide.trunk | ||||
Diff against target: |
305 lines (+169/-0) 10 files modified
qt/build/system.gyp (+17/-0) qt/core/browser/oxide_qt_browser_platform_integration.cc (+6/-0) qt/core/browser/oxide_qt_browser_platform_integration.h (+2/-0) qt/core/browser/oxide_qt_vibration_manager.cc (+57/-0) qt/core/browser/oxide_qt_vibration_manager.h (+56/-0) qt/core/core.gyp (+3/-0) shared/browser/oxide_browser_platform_integration.cc (+4/-0) shared/browser/oxide_browser_platform_integration.h (+5/-0) shared/browser/oxide_content_browser_client.cc (+18/-0) shared/browser/oxide_content_browser_client.h (+1/-0) |
||||
To merge this branch: | bzr merge lp:~abreu-alexandre/oxide/vibrate | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Chris Coulson | Approve | ||
Review via email: mp+261768@code.launchpad.net |
Commit message
Implement vibrate() backend.
Description of the change
Implement vibrate() backend.
David Barth (dbarth) wrote : | # |
Chris Coulson (chrisccoulson) wrote : | # |
I've left some comments inline
Chris Coulson (chrisccoulson) wrote : | # |
Thanks, there's a couple of small comments inline
- 1273. By Chris Coulson
-
Merge from lp:oxide/crmaster
This fixes LP: #1336440 by pulling Chromium and some modified sub-projects from GIT repositories hosted on Launchpad.
With this, the workflow for updating Chromium and applying modifications to Chromium or its subprojects changes significantly. Documentation for this will be coming...Also, client.py has been renamed to init-checkout.py - the original name came from the script used to check out Thunderbird, but it's never really made sense
- 1274. By Chris Coulson
-
WebView.loading changing to false appears to be the last event in a load now, so update the tests to reflect this
- 1275. By Chris Coulson
-
Enable NEON unconditionally on arm. This means we don't have to modify webrtc and openmax
- 1276. By Chris Coulson
-
Bump Chromium rev to 48.0.2564.8
- 1277. By Chris Coulson
-
Bump Chromium rev to b1bedd5f
- 1278. By Chris Coulson
-
Bump Chromium rev to 4c09f100 (merge from 48.0.2564.10)
- 1279. By Olivier Tilloy
-
Correctly report when the webview has actual active focus (check that its parent window is active).
- 1280. By Chris Coulson
-
Delete StoragePermissi
onRequest and make WebContext. storageAccessPe rmissionDelegat e a noop. This functionality has never been tested, it wasn't finished to a standard that would make it useful anywhere, nobody is using it and it's going to get in the way of site-settings
Alexandre Abreu (abreu-alexandre) wrote : | # |
updated
(and see reply to comment)
- 1281. By Olivier Tilloy
-
Add a hoveredUrl property to the QML WebView API.
- 1282. By Chris Coulson
-
Fix a typo
- 1283. By Chris Coulson
-
Use Qt::PrimaryOrie
ntation rather than passing in QScreen's own primary orientation - 1284. By Chris Coulson
-
QCoreApplicatio
n::applicationN ame() isn't really thread-safe - cache it to protect against accessing this whilst the application is modifying it (although we don't really expect this to change) - 1285. By Chris Coulson
-
Build with 'use_ash: 0' as this seems to be pulling in dependencies from //chrome, resulting in random mis-builds
- 1286. By Chris Coulson
-
Bump Chromium rev to 0fcc1746 (48.0.2564.22)
- 1287. By Chris Coulson
-
Add support for the camera on the phone. Note this requires changes to libhybris that aren't approved yet, so some bits may change. It's also hidden behind a build option (ENABLE_
HYBRIS_ CAMERA)
Chris Coulson (chrisccoulson) wrote : | # |
I've replied to the comment - this code doesn't really make sense
Chris Coulson (chrisccoulson) wrote : | # |
Helps if I include the comment
- 1288. By Chris Coulson
-
Don't require libhybris-dev to be installed when building without ENABLE_
HYBRIS_ CAMERA - 1289. By Chris Coulson
-
Merge from lp:oxide/crmaster
- 1290. By Chris Coulson
-
Bump qt version to 1.13
- 1291. By Chris Coulson
-
Bump Chromium rev to dee8b819 (49.0.2587.3)
- 1292. By Chris Coulson
-
Fix OxideQCertifica
teError: :isMainFrame to work with Chromium 49 - 1293. By Chris Coulson
-
Don't build qt/core/api in a separate target with different build options. This means we can stop linking unconditionally with --gc-sections. It also means that the public API no longer has RTTI enabled - if we need this in the future, we'll have to split it out again and plumb it through a proxy layer like we do with qt/quick/api
- 1294. By Chris Coulson
-
Merge r1067 from lp:oxide/crmaster
- 1295. By Chris Coulson
-
Bump Chromium rev to 8af47bb2 (49.0.2593.0)
- 1296. By Chris Coulson
-
Bump Chromium rev to a6f2995b to pick up build fix
- 1297. By Chris Coulson
-
Pass StartParams by value and give it a move constructor - this makes it obvious that the StartParams passed to BrowserProcessM
ain::Start is no longer valid once the function returns - 1298. By Chris Coulson
-
Merge r1072 from lp:oxide/crmaster
- 1299. By Chris Coulson
-
Bump Chromium rev to 3bbb11d8 (49.0.2612.0)
- 1300. By Chris Coulson
-
Check the return value from android_
camera_ get_device_ info - 1301. By Chris Coulson
-
Check the return of android_
camera_ get_device_ info in another location - 1302. By Chris Coulson
-
Fix an import failure in release.py
- 1303. By Chris Coulson
-
Update the exclude list and call init-checkout.py from release.py
- 1304. By Olivier Tilloy
-
Add missing revision qualifier to the WebView.hoveredUrl property.
- 1305. By Chris Coulson
-
Be a bit more intelligent when detecting whether the hybris camera compatibility layer is available, or whether we're running on the Android EGL stack
- 1306. By Chris Coulson
-
Expose value type enums to QML in Qt5.5
- 1307. By Olivier Tilloy
-
Update to oxide.qmltypes missed at revision 1304.
- 1308. By Chris Coulson
-
Don't include .git/index files anywhere in the tarball. This was added way back in r640 but doesn't actually fix anything, and instead causes LP: #1490868 to be reintroduced in official builds where we don't install git
- 1309. By Olivier Tilloy
-
Add a touch selection API, to allow embedders to display handles for resizing the current selection, and contextual actions for it.
- 1310. By Chris Coulson
-
Make QFlags naming consistent betweeen qt/core/api and qt/quick/api
- 1311. By Chris Coulson
-
Various clean-ups in soon-to-be-public headers. Also, we rename header files based on whether they're going to be public or not
- 1312. By Chris Coulson
-
Ensure we define OXIDE_QTQUICK_
IMPLEMENTATION as part of the build - 1313. By Chris Coulson
-
Remove SimplePermissio
nRequest - 1314. By Chris Coulson
-
Register PermissionRequest and MediaAccessPerm
issionRequest - 1315. By Chris Coulson
-
Add deprecation warnings for deprecated APIs
- 1316. By Chris Coulson
-
Add missing file
- 1317. By Chris Coulson
-
Disable the unprivileged namespace sandbox and fallback to the suid sandbox until we've figured out how it fits in with application confinement
- 1318. By Chris Coulson
-
Make a few changes to the build system:
- package is renamed to test-package, as the former is a reserved target in cmake. This gets rid of a warning.
- Use the built-in option command.
- Move a bunch of stuff from qt/CMakeLists.txt to CMakeLists.txt - 1319. By Chris Coulson
-
Use INTERFACE_
LINK_LIBRARIES for OXIDE_LIB, and make some libraries linked in to OXIDE_QUICKLIB public - 1320. By Chris Coulson
-
Merge r1085 from lp:oxide/crmaster
- 1321. By Chris Coulson
-
Bump Chromium rev to c51aaef (49.0.2623.0)
- 1322. By Chris Coulson
-
Unbreak cross-compiles and make sure we test the version of the correct module
- 1323. By Chris Coulson
-
Merge in various build changes:
- Split out some code in to CMake modules
- Use CMake's PROJECT_VERSION properties rather than our own OXIDE_VERSION
- Install public header files
- Create and install CMake package config files - 1324. By Chris Coulson
-
Safely handle event loop nesting from outside of Oxide
- 1325. By Chris Coulson
-
Bump Chromium rev to 37948b2 (49.0.2623.13)
- 1326. By Chris Coulson
-
Update the deprecation warning for loadingChanged and add a macro for doing this as well
- 1327. By Chris Coulson
-
Bump Chromium rev to 8e193e1 (49.0.2623.23)
- 1328. By Alexandre Abreu
-
Vibration API support
- 1329. By Alexandre Abreu
-
Undo local build specific commit
Chris Coulson (chrisccoulson) : | # |
David Barth (dbarth) wrote : | # |
And there was /much/ rejoicing ! :) Great to see this branch in trunk.
On Thu, Feb 11, 2016 at 8:00 PM, Chris Coulson <email address hidden>
wrote:
> Review: Approve
>
>
> --
> https:/
> Your team Oxide Developers is subscribed to branch lp:oxide.
>
Preview Diff
1 | === modified file 'qt/build/system.gyp' |
2 | --- qt/build/system.gyp 2015-10-28 19:09:39 +0000 |
3 | +++ qt/build/system.gyp 2016-02-01 20:21:37 +0000 |
4 | @@ -107,5 +107,22 @@ |
5 | ], |
6 | }, |
7 | }, |
8 | + { |
9 | + 'target_name': 'Qt5Feedback', |
10 | + 'type': 'none', |
11 | + 'direct_dependent_settings': { |
12 | + 'cflags_cc': [ |
13 | + '<!@(<(pkg_config) --cflags Qt5Feedback)' |
14 | + ] |
15 | + }, |
16 | + 'link_settings': { |
17 | + 'ldflags': [ |
18 | + '<!@(<(pkg_config) --libs-only-L --libs-only-other Qt5Feedback)', |
19 | + ], |
20 | + 'libraries': [ |
21 | + '<!@(<(pkg_config) --libs-only-l Qt5Feedback)', |
22 | + ], |
23 | + }, |
24 | + }, |
25 | ], |
26 | } |
27 | |
28 | === modified file 'qt/core/browser/oxide_qt_browser_platform_integration.cc' |
29 | --- qt/core/browser/oxide_qt_browser_platform_integration.cc 2016-01-08 21:01:08 +0000 |
30 | +++ qt/core/browser/oxide_qt_browser_platform_integration.cc 2016-02-01 20:21:37 +0000 |
31 | @@ -44,6 +44,7 @@ |
32 | #include "oxide_qt_location_provider.h" |
33 | #include "oxide_qt_message_pump.h" |
34 | #include "oxide_qt_screen_utils.h" |
35 | +#include "oxide_qt_vibration_manager.h" |
36 | |
37 | namespace oxide { |
38 | namespace qt { |
39 | @@ -242,6 +243,11 @@ |
40 | qApp->removeEventFilter(this); |
41 | } |
42 | |
43 | +void BrowserPlatformIntegration::CreateVibrationManager( |
44 | + mojo::InterfaceRequest<device::VibrationManager> request) { |
45 | + VibrationManager::Create(std::move(request)); |
46 | +} |
47 | + |
48 | QThread* GetIOQThread() { |
49 | return g_io_thread.Get(); |
50 | } |
51 | |
52 | === modified file 'qt/core/browser/oxide_qt_browser_platform_integration.h' |
53 | --- qt/core/browser/oxide_qt_browser_platform_integration.h 2015-12-11 17:01:08 +0000 |
54 | +++ qt/core/browser/oxide_qt_browser_platform_integration.h 2016-02-01 20:21:37 +0000 |
55 | @@ -64,6 +64,8 @@ |
56 | scoped_ptr<content::LocationProvider> CreateLocationProvider() override; |
57 | ApplicationState GetApplicationState() override; |
58 | std::string GetApplicationName() override; |
59 | + void CreateVibrationManager( |
60 | + mojo::InterfaceRequest<device::VibrationManager> request) override; |
61 | |
62 | // QObject implementation |
63 | bool eventFilter(QObject* watched, QEvent* event) override; |
64 | |
65 | === added file 'qt/core/browser/oxide_qt_vibration_manager.cc' |
66 | --- qt/core/browser/oxide_qt_vibration_manager.cc 1970-01-01 00:00:00 +0000 |
67 | +++ qt/core/browser/oxide_qt_vibration_manager.cc 2016-02-01 20:21:37 +0000 |
68 | @@ -0,0 +1,57 @@ |
69 | +// vim:expandtab:shiftwidth=2:tabstop=2: |
70 | +// Copyright (C) 2015 Canonical Ltd. |
71 | + |
72 | +// This library is free software; you can redistribute it and/or |
73 | +// modify it under the terms of the GNU Lesser General Public |
74 | +// License as published by the Free Software Foundation; either |
75 | +// version 2.1 of the License, or (at your option) any later version. |
76 | + |
77 | +// This library is distributed in the hope that it will be useful, |
78 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
79 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
80 | +// Lesser General Public License for more details. |
81 | + |
82 | +// You should have received a copy of the GNU Lesser General Public |
83 | +// License along with this library; if not, write to the Free Software |
84 | +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
85 | + |
86 | +#include "oxide_qt_vibration_manager.h" |
87 | + |
88 | +#include "base/logging.h" |
89 | + |
90 | +#include <QFeedbackHapticsEffect> |
91 | + |
92 | +namespace oxide { |
93 | +namespace qt { |
94 | + |
95 | +namespace { |
96 | +const double kVibrationIntensity = 1.0; |
97 | +} |
98 | + |
99 | +// static |
100 | +void VibrationManager::Create(mojo::InterfaceRequest<device::VibrationManager> request) { |
101 | + new VibrationManager(std::move(request)); |
102 | +} |
103 | + |
104 | +VibrationManager::VibrationManager( |
105 | + mojo::InterfaceRequest<device::VibrationManager> request) |
106 | + : binding_(this, std::move(request)), |
107 | + vibration_(new QFeedbackHapticsEffect()) { |
108 | +} |
109 | +VibrationManager::~VibrationManager() {} |
110 | + |
111 | +void VibrationManager::Vibrate(int64_t milliseconds) { |
112 | + Cancel(); |
113 | + |
114 | + vibration_->setIntensity(kVibrationIntensity); |
115 | + vibration_->setDuration(milliseconds); |
116 | + vibration_->start(); |
117 | +} |
118 | + |
119 | +void VibrationManager::Cancel() { |
120 | + vibration_->stop(); |
121 | +} |
122 | + |
123 | +} // namespace qt |
124 | +} // namespace oxide |
125 | + |
126 | |
127 | === added file 'qt/core/browser/oxide_qt_vibration_manager.h' |
128 | --- qt/core/browser/oxide_qt_vibration_manager.h 1970-01-01 00:00:00 +0000 |
129 | +++ qt/core/browser/oxide_qt_vibration_manager.h 2016-02-01 20:21:37 +0000 |
130 | @@ -0,0 +1,56 @@ |
131 | +// vim:expandtab:shiftwidth=2:tabstop=2: |
132 | +// Copyright (C) 2015 Canonical Ltd. |
133 | + |
134 | +// This library is free software; you can redistribute it and/or |
135 | +// modify it under the terms of the GNU Lesser General Public |
136 | +// License as published by the Free Software Foundation; either |
137 | +// version 2.1 of the License, or (at your option) any later version. |
138 | + |
139 | +// This library is distributed in the hope that it will be useful, |
140 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
141 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
142 | +// Lesser General Public License for more details. |
143 | + |
144 | +// You should have received a copy of the GNU Lesser General Public |
145 | +// License along with this library; if not, write to the Free Software |
146 | +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
147 | + |
148 | +#ifndef _OXIDE_QT_CORE_BROWSER_VIBRATION_MANAGER_H_ |
149 | +#define _OXIDE_QT_CORE_BROWSER_VIBRATION_MANAGER_H_ |
150 | + |
151 | +#include <QtGlobal> |
152 | + |
153 | +#include "base/macros.h" |
154 | +#include "base/memory/scoped_ptr.h" |
155 | + |
156 | +#include "mojo/public/cpp/bindings/strong_binding.h" |
157 | + |
158 | +#include "device/vibration/vibration_manager_impl.h" |
159 | + |
160 | +QT_BEGIN_NAMESPACE |
161 | +class QFeedbackHapticsEffect; |
162 | +QT_END_NAMESPACE |
163 | + |
164 | +namespace oxide { |
165 | +namespace qt { |
166 | + |
167 | +class VibrationManager : public device::VibrationManager { |
168 | + public: |
169 | + static void Create(mojo::InterfaceRequest<device::VibrationManager> request); |
170 | + |
171 | + void Vibrate(int64_t milliseconds) override; |
172 | + void Cancel() override; |
173 | + |
174 | + private: |
175 | + VibrationManager(mojo::InterfaceRequest<device::VibrationManager> request); |
176 | + ~VibrationManager() override; |
177 | + |
178 | + mojo::StrongBinding<device::VibrationManager> binding_; |
179 | + scoped_ptr<QFeedbackHapticsEffect> vibration_; |
180 | +}; |
181 | + |
182 | +} // namespace qt |
183 | +} // namespace oxide |
184 | + |
185 | +#endif // _OXIDE_QT_CORE_BROWSER_VIBRATION_MANAGER_H_ |
186 | + |
187 | |
188 | === modified file 'qt/core/core.gyp' |
189 | --- qt/core/core.gyp 2016-01-20 21:40:55 +0000 |
190 | +++ qt/core/core.gyp 2016-02-01 20:21:37 +0000 |
191 | @@ -27,6 +27,7 @@ |
192 | 'dependencies': [ |
193 | '../build/system.gyp:Qt5Core', |
194 | '../build/system.gyp:Qt5Core-private', |
195 | + '../build/system.gyp:Qt5Feedback', |
196 | '../build/system.gyp:Qt5Gui', |
197 | '../build/system.gyp:Qt5Gui-private', |
198 | '../build/system.gyp:Qt5Network', |
199 | @@ -158,6 +159,8 @@ |
200 | 'browser/oxide_qt_user_script.h', |
201 | 'browser/oxide_qt_variant_value_converter.cc', |
202 | 'browser/oxide_qt_variant_value_converter.h', |
203 | + 'browser/oxide_qt_vibration_manager.cc', |
204 | + 'browser/oxide_qt_vibration_manager.h', |
205 | 'browser/oxide_qt_web_context.cc', |
206 | 'browser/oxide_qt_web_context.h', |
207 | 'browser/oxide_qt_web_context_menu.cc', |
208 | |
209 | === modified file 'shared/browser/oxide_browser_platform_integration.cc' |
210 | --- shared/browser/oxide_browser_platform_integration.cc 2015-12-11 17:01:08 +0000 |
211 | +++ shared/browser/oxide_browser_platform_integration.cc 2016-02-01 20:21:37 +0000 |
212 | @@ -107,4 +107,8 @@ |
213 | ClipboardDataChanged()); |
214 | } |
215 | |
216 | +void BrowserPlatformIntegration::CreateVibrationManager( |
217 | + mojo::InterfaceRequest<device::VibrationManager> request) { |
218 | +} |
219 | + |
220 | } // namespace oxide |
221 | |
222 | === modified file 'shared/browser/oxide_browser_platform_integration.h' |
223 | --- shared/browser/oxide_browser_platform_integration.h 2015-12-11 17:01:08 +0000 |
224 | +++ shared/browser/oxide_browser_platform_integration.h 2016-02-01 20:21:37 +0000 |
225 | @@ -24,6 +24,7 @@ |
226 | #include "base/memory/scoped_ptr.h" |
227 | #include "base/observer_list.h" |
228 | #include "content/public/browser/browser_thread.h" |
229 | +#include "device/vibration/vibration_manager_impl.h" |
230 | #include "third_party/WebKit/public/platform/WebScreenInfo.h" |
231 | |
232 | class GURL; |
233 | @@ -105,6 +106,10 @@ |
234 | // Get the application name. Can be called on any thread |
235 | virtual std::string GetApplicationName(); |
236 | |
237 | + // Get the proper vibration manager factory |
238 | + virtual void CreateVibrationManager( |
239 | + mojo::InterfaceRequest<device::VibrationManager> request); |
240 | + |
241 | protected: |
242 | BrowserPlatformIntegration(); |
243 | |
244 | |
245 | === modified file 'shared/browser/oxide_content_browser_client.cc' |
246 | --- shared/browser/oxide_content_browser_client.cc 2016-01-08 21:31:20 +0000 |
247 | +++ shared/browser/oxide_content_browser_client.cc 2016-02-01 20:21:37 +0000 |
248 | @@ -25,6 +25,7 @@ |
249 | #include "base/logging.h" |
250 | #include "base/memory/ref_counted.h" |
251 | #include "base/memory/scoped_ptr.h" |
252 | +#include "content/public/common/service_registry.h" |
253 | #include "content/public/browser/certificate_request_result_type.h" |
254 | #include "content/public/browser/geolocation_provider.h" |
255 | #include "content/public/browser/location_provider.h" |
256 | @@ -34,6 +35,7 @@ |
257 | #include "content/public/browser/resource_dispatcher_host.h" |
258 | #include "content/public/common/content_switches.h" |
259 | #include "content/public/common/web_preferences.h" |
260 | +#include "device/vibration/vibration_manager_impl.h" |
261 | |
262 | #include "shared/browser/compositor/oxide_compositor_utils.h" |
263 | #include "shared/browser/media/oxide_media_capture_devices_dispatcher.h" |
264 | @@ -67,6 +69,16 @@ |
265 | #include "pepper/oxide_pepper_host_factory_browser.h" |
266 | #endif |
267 | |
268 | +namespace { |
269 | + |
270 | +void CreateVibrationManager( |
271 | + mojo::InterfaceRequest<device::VibrationManager> request) { |
272 | + oxide::BrowserPlatformIntegration::GetInstance() |
273 | + ->CreateVibrationManager(std::move(request)); |
274 | +} |
275 | + |
276 | +} |
277 | + |
278 | namespace oxide { |
279 | |
280 | content::BrowserMainParts* ContentBrowserClient::CreateBrowserMainParts( |
281 | @@ -306,6 +318,12 @@ |
282 | return application_locale_; |
283 | } |
284 | |
285 | +void ContentBrowserClient::RegisterRenderProcessMojoServices( |
286 | + content::ServiceRegistry* registry) { |
287 | + DCHECK(registry); |
288 | + registry->AddService(base::Bind(&CreateVibrationManager)); |
289 | +} |
290 | + |
291 | ContentBrowserClient::ContentBrowserClient( |
292 | const std::string& application_locale, |
293 | BrowserPlatformIntegration* integration) |
294 | |
295 | === modified file 'shared/browser/oxide_content_browser_client.h' |
296 | --- shared/browser/oxide_content_browser_client.h 2015-12-19 00:53:56 +0000 |
297 | +++ shared/browser/oxide_content_browser_client.h 2016-02-01 20:21:37 +0000 |
298 | @@ -118,6 +118,7 @@ |
299 | void DidCreatePpapiPlugin(content::BrowserPpapiHost* browser_host) final; |
300 | gpu::GpuControlList::OsType GetOsTypeOverrideForGpuDataManager( |
301 | std::string* os_version) final; |
302 | + void RegisterRenderProcessMojoServices(content::ServiceRegistry* registry) final; |
303 | |
304 | std::string application_locale_; |
305 | scoped_ptr<BrowserPlatformIntegration> platform_integration_; |
Chris: can you give us some feedback on what is holding this branch from being merged in?