Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: mojo/dart/packages/mojo_services/lib/activity/activity.mojom.dart

Issue 1998433002: Dart: Adds Interface and InterfaceRequest interfaces. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Merge Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 library activity_mojom; 5 library activity_mojom;
6 import 'dart:async'; 6 import 'dart:async';
7 import 'package:mojo/bindings.dart' as bindings; 7 import 'package:mojo/bindings.dart' as bindings;
8 import 'package:mojo/core.dart' as core; 8 import 'package:mojo/core.dart' as core;
9 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic e_describer; 9 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic e_describer;
10 10
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after
690 map["primaryColor"] = primaryColor; 690 map["primaryColor"] = primaryColor;
691 return map; 691 return map;
692 } 692 }
693 } 693 }
694 694
695 695
696 class _ActivityGetUserFeedbackParams extends bindings.Struct { 696 class _ActivityGetUserFeedbackParams extends bindings.Struct {
697 static const List<bindings.StructDataHeader> kVersions = const [ 697 static const List<bindings.StructDataHeader> kVersions = const [
698 const bindings.StructDataHeader(16, 0) 698 const bindings.StructDataHeader(16, 0)
699 ]; 699 ];
700 Object userFeedback = null; 700 UserFeedbackInterfaceRequest userFeedback = null;
701 701
702 _ActivityGetUserFeedbackParams() : super(kVersions.last.size); 702 _ActivityGetUserFeedbackParams() : super(kVersions.last.size);
703 703
704 static _ActivityGetUserFeedbackParams deserialize(bindings.Message message) { 704 static _ActivityGetUserFeedbackParams deserialize(bindings.Message message) {
705 var decoder = new bindings.Decoder(message); 705 var decoder = new bindings.Decoder(message);
706 var result = decode(decoder); 706 var result = decode(decoder);
707 if (decoder.excessHandles != null) { 707 if (decoder.excessHandles != null) {
708 decoder.excessHandles.forEach((h) => h.close()); 708 decoder.excessHandles.forEach((h) => h.close());
709 } 709 }
710 return result; 710 return result;
(...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after
1674 1674
1675 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => 1675 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) =>
1676 responseFactory(null); 1676 responseFactory(null);
1677 1677
1678 dynamic getAllTypeDefinitions([Function responseFactory]) => 1678 dynamic getAllTypeDefinitions([Function responseFactory]) =>
1679 responseFactory(null); 1679 responseFactory(null);
1680 } 1680 }
1681 1681
1682 abstract class Activity { 1682 abstract class Activity {
1683 static const String serviceName = "activity::Activity"; 1683 static const String serviceName = "activity::Activity";
1684 void getUserFeedback(Object userFeedback); 1684
1685 static service_describer.ServiceDescription _cachedServiceDescription;
1686 static service_describer.ServiceDescription get serviceDescription {
1687 if (_cachedServiceDescription == null) {
1688 _cachedServiceDescription = new _ActivityServiceDescription();
1689 }
1690 return _cachedServiceDescription;
1691 }
1692
1693 static ActivityProxy connectToService(
1694 bindings.ServiceConnector s, String url, [String serviceName]) {
1695 ActivityProxy p = new ActivityProxy.unbound();
1696 String name = serviceName ?? Activity.serviceName;
1697 if ((name == null) || name.isEmpty) {
1698 throw new core.MojoApiError(
1699 "If an interface has no ServiceName, then one must be provided.");
1700 }
1701 s.connectToService(url, p, name);
1702 return p;
1703 }
1704 void getUserFeedback(UserFeedbackInterfaceRequest userFeedback);
1685 void startActivity(Intent intent); 1705 void startActivity(Intent intent);
1686 void finishCurrentActivity(); 1706 void finishCurrentActivity();
1687 void setTaskDescription(TaskDescription description); 1707 void setTaskDescription(TaskDescription description);
1688 void setSystemUiVisibility(SystemUiVisibility visibility); 1708 void setSystemUiVisibility(SystemUiVisibility visibility);
1689 void setRequestedOrientation(ScreenOrientation orientation); 1709 void setRequestedOrientation(ScreenOrientation orientation);
1690 } 1710 }
1691 1711
1712 abstract class ActivityInterface
1713 implements bindings.MojoInterface<Activity>,
1714 Activity {
1715 factory ActivityInterface([Activity impl]) =>
1716 new ActivityStub.unbound(impl);
1717 factory ActivityInterface.fromEndpoint(
1718 core.MojoMessagePipeEndpoint endpoint,
1719 [Activity impl]) =>
1720 new ActivityStub.fromEndpoint(endpoint, impl);
1721 }
1722
1723 abstract class ActivityInterfaceRequest
1724 implements bindings.MojoInterface<Activity>,
1725 Activity {
1726 factory ActivityInterfaceRequest() =>
1727 new ActivityProxy.unbound();
1728 }
1729
1692 class _ActivityProxyControl 1730 class _ActivityProxyControl
1693 extends bindings.ProxyMessageHandler 1731 extends bindings.ProxyMessageHandler
1694 implements bindings.ProxyControl { 1732 implements bindings.ProxyControl<Activity> {
1695 _ActivityProxyControl.fromEndpoint( 1733 _ActivityProxyControl.fromEndpoint(
1696 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); 1734 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint);
1697 1735
1698 _ActivityProxyControl.fromHandle( 1736 _ActivityProxyControl.fromHandle(
1699 core.MojoHandle handle) : super.fromHandle(handle); 1737 core.MojoHandle handle) : super.fromHandle(handle);
1700 1738
1701 _ActivityProxyControl.unbound() : super.unbound(); 1739 _ActivityProxyControl.unbound() : super.unbound();
1702 1740
1703 service_describer.ServiceDescription get serviceDescription =>
1704 new _ActivityServiceDescription();
1705
1706 String get serviceName => Activity.serviceName; 1741 String get serviceName => Activity.serviceName;
1707 1742
1708 void handleResponse(bindings.ServiceMessage message) { 1743 void handleResponse(bindings.ServiceMessage message) {
1709 switch (message.header.type) { 1744 switch (message.header.type) {
1710 default: 1745 default:
1711 proxyError("Unexpected message type: ${message.header.type}"); 1746 proxyError("Unexpected message type: ${message.header.type}");
1712 close(immediate: true); 1747 close(immediate: true);
1713 break; 1748 break;
1714 } 1749 }
1715 } 1750 }
1716 1751
1752 Activity get impl => null;
1753 set impl(Activity _) {
1754 throw new core.MojoApiError("The impl of a Proxy cannot be set.");
1755 }
1756
1717 @override 1757 @override
1718 String toString() { 1758 String toString() {
1719 var superString = super.toString(); 1759 var superString = super.toString();
1720 return "_ActivityProxyControl($superString)"; 1760 return "_ActivityProxyControl($superString)";
1721 } 1761 }
1722 } 1762 }
1723 1763
1724 class ActivityProxy 1764 class ActivityProxy
1725 extends bindings.Proxy 1765 extends bindings.Proxy<Activity>
1726 implements Activity { 1766 implements Activity,
1767 ActivityInterface,
1768 ActivityInterfaceRequest {
1727 ActivityProxy.fromEndpoint( 1769 ActivityProxy.fromEndpoint(
1728 core.MojoMessagePipeEndpoint endpoint) 1770 core.MojoMessagePipeEndpoint endpoint)
1729 : super(new _ActivityProxyControl.fromEndpoint(endpoint)); 1771 : super(new _ActivityProxyControl.fromEndpoint(endpoint));
1730 1772
1731 ActivityProxy.fromHandle(core.MojoHandle handle) 1773 ActivityProxy.fromHandle(core.MojoHandle handle)
1732 : super(new _ActivityProxyControl.fromHandle(handle)); 1774 : super(new _ActivityProxyControl.fromHandle(handle));
1733 1775
1734 ActivityProxy.unbound() 1776 ActivityProxy.unbound()
1735 : super(new _ActivityProxyControl.unbound()); 1777 : super(new _ActivityProxyControl.unbound());
1736 1778
1737 static ActivityProxy newFromEndpoint( 1779 static ActivityProxy newFromEndpoint(
1738 core.MojoMessagePipeEndpoint endpoint) { 1780 core.MojoMessagePipeEndpoint endpoint) {
1739 assert(endpoint.setDescription("For ActivityProxy")); 1781 assert(endpoint.setDescription("For ActivityProxy"));
1740 return new ActivityProxy.fromEndpoint(endpoint); 1782 return new ActivityProxy.fromEndpoint(endpoint);
1741 } 1783 }
1742 1784
1743 factory ActivityProxy.connectToService(
1744 bindings.ServiceConnector s, String url, [String serviceName]) {
1745 ActivityProxy p = new ActivityProxy.unbound();
1746 s.connectToService(url, p, serviceName);
1747 return p;
1748 }
1749 1785
1750 1786 void getUserFeedback(UserFeedbackInterfaceRequest userFeedback) {
1751 void getUserFeedback(Object userFeedback) {
1752 if (!ctrl.isBound) { 1787 if (!ctrl.isBound) {
1753 ctrl.proxyError("The Proxy is closed."); 1788 ctrl.proxyError("The Proxy is closed.");
1754 return; 1789 return;
1755 } 1790 }
1756 var params = new _ActivityGetUserFeedbackParams(); 1791 var params = new _ActivityGetUserFeedbackParams();
1757 params.userFeedback = userFeedback; 1792 params.userFeedback = userFeedback;
1758 ctrl.sendMessage(params, 1793 ctrl.sendMessage(params,
1759 _activityMethodGetUserFeedbackName); 1794 _activityMethodGetUserFeedbackName);
1760 } 1795 }
1761 void startActivity(Intent intent) { 1796 void startActivity(Intent intent) {
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
1821 } 1856 }
1822 1857
1823 _ActivityStubControl.fromHandle( 1858 _ActivityStubControl.fromHandle(
1824 core.MojoHandle handle, [Activity impl]) 1859 core.MojoHandle handle, [Activity impl])
1825 : super.fromHandle(handle, autoBegin: impl != null) { 1860 : super.fromHandle(handle, autoBegin: impl != null) {
1826 _impl = impl; 1861 _impl = impl;
1827 } 1862 }
1828 1863
1829 _ActivityStubControl.unbound([this._impl]) : super.unbound(); 1864 _ActivityStubControl.unbound([this._impl]) : super.unbound();
1830 1865
1866 String get serviceName => Activity.serviceName;
1867
1831 1868
1832 1869
1833 dynamic handleMessage(bindings.ServiceMessage message) { 1870 dynamic handleMessage(bindings.ServiceMessage message) {
1834 if (bindings.ControlMessageHandler.isControlMessage(message)) { 1871 if (bindings.ControlMessageHandler.isControlMessage(message)) {
1835 return bindings.ControlMessageHandler.handleMessage(this, 1872 return bindings.ControlMessageHandler.handleMessage(this,
1836 0, 1873 0,
1837 message); 1874 message);
1838 } 1875 }
1839 if (_impl == null) { 1876 if (_impl == null) {
1840 throw new core.MojoApiError("$this has no implementation set"); 1877 throw new core.MojoApiError("$this has no implementation set");
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
1894 } 1931 }
1895 } 1932 }
1896 1933
1897 @override 1934 @override
1898 String toString() { 1935 String toString() {
1899 var superString = super.toString(); 1936 var superString = super.toString();
1900 return "_ActivityStubControl($superString)"; 1937 return "_ActivityStubControl($superString)";
1901 } 1938 }
1902 1939
1903 int get version => 0; 1940 int get version => 0;
1904
1905 static service_describer.ServiceDescription _cachedServiceDescription;
1906 static service_describer.ServiceDescription get serviceDescription {
1907 if (_cachedServiceDescription == null) {
1908 _cachedServiceDescription = new _ActivityServiceDescription();
1909 }
1910 return _cachedServiceDescription;
1911 }
1912 } 1941 }
1913 1942
1914 class ActivityStub 1943 class ActivityStub
1915 extends bindings.Stub<Activity> 1944 extends bindings.Stub<Activity>
1916 implements Activity { 1945 implements Activity,
1946 ActivityInterface,
1947 ActivityInterfaceRequest {
1948 ActivityStub.unbound([Activity impl])
1949 : super(new _ActivityStubControl.unbound(impl));
1950
1917 ActivityStub.fromEndpoint( 1951 ActivityStub.fromEndpoint(
1918 core.MojoMessagePipeEndpoint endpoint, [Activity impl]) 1952 core.MojoMessagePipeEndpoint endpoint, [Activity impl])
1919 : super(new _ActivityStubControl.fromEndpoint(endpoint, impl)); 1953 : super(new _ActivityStubControl.fromEndpoint(endpoint, impl));
1920 1954
1921 ActivityStub.fromHandle( 1955 ActivityStub.fromHandle(
1922 core.MojoHandle handle, [Activity impl]) 1956 core.MojoHandle handle, [Activity impl])
1923 : super(new _ActivityStubControl.fromHandle(handle, impl)); 1957 : super(new _ActivityStubControl.fromHandle(handle, impl));
1924 1958
1925 ActivityStub.unbound([Activity impl])
1926 : super(new _ActivityStubControl.unbound(impl));
1927
1928 static ActivityStub newFromEndpoint( 1959 static ActivityStub newFromEndpoint(
1929 core.MojoMessagePipeEndpoint endpoint) { 1960 core.MojoMessagePipeEndpoint endpoint) {
1930 assert(endpoint.setDescription("For ActivityStub")); 1961 assert(endpoint.setDescription("For ActivityStub"));
1931 return new ActivityStub.fromEndpoint(endpoint); 1962 return new ActivityStub.fromEndpoint(endpoint);
1932 } 1963 }
1933 1964
1934 static service_describer.ServiceDescription get serviceDescription =>
1935 _ActivityStubControl.serviceDescription;
1936 1965
1937 1966 void getUserFeedback(UserFeedbackInterfaceRequest userFeedback) {
1938 void getUserFeedback(Object userFeedback) {
1939 return impl.getUserFeedback(userFeedback); 1967 return impl.getUserFeedback(userFeedback);
1940 } 1968 }
1941 void startActivity(Intent intent) { 1969 void startActivity(Intent intent) {
1942 return impl.startActivity(intent); 1970 return impl.startActivity(intent);
1943 } 1971 }
1944 void finishCurrentActivity() { 1972 void finishCurrentActivity() {
1945 return impl.finishCurrentActivity(); 1973 return impl.finishCurrentActivity();
1946 } 1974 }
1947 void setTaskDescription(TaskDescription description) { 1975 void setTaskDescription(TaskDescription description) {
1948 return impl.setTaskDescription(description); 1976 return impl.setTaskDescription(description);
(...skipping 16 matching lines...) Expand all
1965 1993
1966 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => 1994 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) =>
1967 responseFactory(null); 1995 responseFactory(null);
1968 1996
1969 dynamic getAllTypeDefinitions([Function responseFactory]) => 1997 dynamic getAllTypeDefinitions([Function responseFactory]) =>
1970 responseFactory(null); 1998 responseFactory(null);
1971 } 1999 }
1972 2000
1973 abstract class PathService { 2001 abstract class PathService {
1974 static const String serviceName = "activity::PathService"; 2002 static const String serviceName = "activity::PathService";
2003
2004 static service_describer.ServiceDescription _cachedServiceDescription;
2005 static service_describer.ServiceDescription get serviceDescription {
2006 if (_cachedServiceDescription == null) {
2007 _cachedServiceDescription = new _PathServiceServiceDescription();
2008 }
2009 return _cachedServiceDescription;
2010 }
2011
2012 static PathServiceProxy connectToService(
2013 bindings.ServiceConnector s, String url, [String serviceName]) {
2014 PathServiceProxy p = new PathServiceProxy.unbound();
2015 String name = serviceName ?? PathService.serviceName;
2016 if ((name == null) || name.isEmpty) {
2017 throw new core.MojoApiError(
2018 "If an interface has no ServiceName, then one must be provided.");
2019 }
2020 s.connectToService(url, p, name);
2021 return p;
2022 }
1975 dynamic getAppDataDir([Function responseFactory = null]); 2023 dynamic getAppDataDir([Function responseFactory = null]);
1976 dynamic getFilesDir([Function responseFactory = null]); 2024 dynamic getFilesDir([Function responseFactory = null]);
1977 dynamic getCacheDir([Function responseFactory = null]); 2025 dynamic getCacheDir([Function responseFactory = null]);
1978 } 2026 }
1979 2027
2028 abstract class PathServiceInterface
2029 implements bindings.MojoInterface<PathService>,
2030 PathService {
2031 factory PathServiceInterface([PathService impl]) =>
2032 new PathServiceStub.unbound(impl);
2033 factory PathServiceInterface.fromEndpoint(
2034 core.MojoMessagePipeEndpoint endpoint,
2035 [PathService impl]) =>
2036 new PathServiceStub.fromEndpoint(endpoint, impl);
2037 }
2038
2039 abstract class PathServiceInterfaceRequest
2040 implements bindings.MojoInterface<PathService>,
2041 PathService {
2042 factory PathServiceInterfaceRequest() =>
2043 new PathServiceProxy.unbound();
2044 }
2045
1980 class _PathServiceProxyControl 2046 class _PathServiceProxyControl
1981 extends bindings.ProxyMessageHandler 2047 extends bindings.ProxyMessageHandler
1982 implements bindings.ProxyControl { 2048 implements bindings.ProxyControl<PathService> {
1983 _PathServiceProxyControl.fromEndpoint( 2049 _PathServiceProxyControl.fromEndpoint(
1984 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); 2050 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint);
1985 2051
1986 _PathServiceProxyControl.fromHandle( 2052 _PathServiceProxyControl.fromHandle(
1987 core.MojoHandle handle) : super.fromHandle(handle); 2053 core.MojoHandle handle) : super.fromHandle(handle);
1988 2054
1989 _PathServiceProxyControl.unbound() : super.unbound(); 2055 _PathServiceProxyControl.unbound() : super.unbound();
1990 2056
1991 service_describer.ServiceDescription get serviceDescription =>
1992 new _PathServiceServiceDescription();
1993
1994 String get serviceName => PathService.serviceName; 2057 String get serviceName => PathService.serviceName;
1995 2058
1996 void handleResponse(bindings.ServiceMessage message) { 2059 void handleResponse(bindings.ServiceMessage message) {
1997 switch (message.header.type) { 2060 switch (message.header.type) {
1998 case _pathServiceMethodGetAppDataDirName: 2061 case _pathServiceMethodGetAppDataDirName:
1999 var r = PathServiceGetAppDataDirResponseParams.deserialize( 2062 var r = PathServiceGetAppDataDirResponseParams.deserialize(
2000 message.payload); 2063 message.payload);
2001 if (!message.header.hasRequestId) { 2064 if (!message.header.hasRequestId) {
2002 proxyError("Expected a message with a valid request Id."); 2065 proxyError("Expected a message with a valid request Id.");
2003 return; 2066 return;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
2055 } 2118 }
2056 c.complete(r); 2119 c.complete(r);
2057 break; 2120 break;
2058 default: 2121 default:
2059 proxyError("Unexpected message type: ${message.header.type}"); 2122 proxyError("Unexpected message type: ${message.header.type}");
2060 close(immediate: true); 2123 close(immediate: true);
2061 break; 2124 break;
2062 } 2125 }
2063 } 2126 }
2064 2127
2128 PathService get impl => null;
2129 set impl(PathService _) {
2130 throw new core.MojoApiError("The impl of a Proxy cannot be set.");
2131 }
2132
2065 @override 2133 @override
2066 String toString() { 2134 String toString() {
2067 var superString = super.toString(); 2135 var superString = super.toString();
2068 return "_PathServiceProxyControl($superString)"; 2136 return "_PathServiceProxyControl($superString)";
2069 } 2137 }
2070 } 2138 }
2071 2139
2072 class PathServiceProxy 2140 class PathServiceProxy
2073 extends bindings.Proxy 2141 extends bindings.Proxy<PathService>
2074 implements PathService { 2142 implements PathService,
2143 PathServiceInterface,
2144 PathServiceInterfaceRequest {
2075 PathServiceProxy.fromEndpoint( 2145 PathServiceProxy.fromEndpoint(
2076 core.MojoMessagePipeEndpoint endpoint) 2146 core.MojoMessagePipeEndpoint endpoint)
2077 : super(new _PathServiceProxyControl.fromEndpoint(endpoint)); 2147 : super(new _PathServiceProxyControl.fromEndpoint(endpoint));
2078 2148
2079 PathServiceProxy.fromHandle(core.MojoHandle handle) 2149 PathServiceProxy.fromHandle(core.MojoHandle handle)
2080 : super(new _PathServiceProxyControl.fromHandle(handle)); 2150 : super(new _PathServiceProxyControl.fromHandle(handle));
2081 2151
2082 PathServiceProxy.unbound() 2152 PathServiceProxy.unbound()
2083 : super(new _PathServiceProxyControl.unbound()); 2153 : super(new _PathServiceProxyControl.unbound());
2084 2154
2085 static PathServiceProxy newFromEndpoint( 2155 static PathServiceProxy newFromEndpoint(
2086 core.MojoMessagePipeEndpoint endpoint) { 2156 core.MojoMessagePipeEndpoint endpoint) {
2087 assert(endpoint.setDescription("For PathServiceProxy")); 2157 assert(endpoint.setDescription("For PathServiceProxy"));
2088 return new PathServiceProxy.fromEndpoint(endpoint); 2158 return new PathServiceProxy.fromEndpoint(endpoint);
2089 } 2159 }
2090 2160
2091 factory PathServiceProxy.connectToService(
2092 bindings.ServiceConnector s, String url, [String serviceName]) {
2093 PathServiceProxy p = new PathServiceProxy.unbound();
2094 s.connectToService(url, p, serviceName);
2095 return p;
2096 }
2097
2098 2161
2099 dynamic getAppDataDir([Function responseFactory = null]) { 2162 dynamic getAppDataDir([Function responseFactory = null]) {
2100 var params = new _PathServiceGetAppDataDirParams(); 2163 var params = new _PathServiceGetAppDataDirParams();
2101 return ctrl.sendMessageWithRequestId( 2164 return ctrl.sendMessageWithRequestId(
2102 params, 2165 params,
2103 _pathServiceMethodGetAppDataDirName, 2166 _pathServiceMethodGetAppDataDirName,
2104 -1, 2167 -1,
2105 bindings.MessageHeader.kMessageExpectsResponse); 2168 bindings.MessageHeader.kMessageExpectsResponse);
2106 } 2169 }
2107 dynamic getFilesDir([Function responseFactory = null]) { 2170 dynamic getFilesDir([Function responseFactory = null]) {
(...skipping 26 matching lines...) Expand all
2134 } 2197 }
2135 2198
2136 _PathServiceStubControl.fromHandle( 2199 _PathServiceStubControl.fromHandle(
2137 core.MojoHandle handle, [PathService impl]) 2200 core.MojoHandle handle, [PathService impl])
2138 : super.fromHandle(handle, autoBegin: impl != null) { 2201 : super.fromHandle(handle, autoBegin: impl != null) {
2139 _impl = impl; 2202 _impl = impl;
2140 } 2203 }
2141 2204
2142 _PathServiceStubControl.unbound([this._impl]) : super.unbound(); 2205 _PathServiceStubControl.unbound([this._impl]) : super.unbound();
2143 2206
2207 String get serviceName => PathService.serviceName;
2208
2144 2209
2145 PathServiceGetAppDataDirResponseParams _pathServiceGetAppDataDirResponseParams Factory(String path) { 2210 PathServiceGetAppDataDirResponseParams _pathServiceGetAppDataDirResponseParams Factory(String path) {
2146 var result = new PathServiceGetAppDataDirResponseParams(); 2211 var result = new PathServiceGetAppDataDirResponseParams();
2147 result.path = path; 2212 result.path = path;
2148 return result; 2213 return result;
2149 } 2214 }
2150 PathServiceGetFilesDirResponseParams _pathServiceGetFilesDirResponseParamsFact ory(String path) { 2215 PathServiceGetFilesDirResponseParams _pathServiceGetFilesDirResponseParamsFact ory(String path) {
2151 var result = new PathServiceGetFilesDirResponseParams(); 2216 var result = new PathServiceGetFilesDirResponseParams();
2152 result.path = path; 2217 result.path = path;
2153 return result; 2218 return result;
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
2254 } 2319 }
2255 } 2320 }
2256 2321
2257 @override 2322 @override
2258 String toString() { 2323 String toString() {
2259 var superString = super.toString(); 2324 var superString = super.toString();
2260 return "_PathServiceStubControl($superString)"; 2325 return "_PathServiceStubControl($superString)";
2261 } 2326 }
2262 2327
2263 int get version => 0; 2328 int get version => 0;
2264
2265 static service_describer.ServiceDescription _cachedServiceDescription;
2266 static service_describer.ServiceDescription get serviceDescription {
2267 if (_cachedServiceDescription == null) {
2268 _cachedServiceDescription = new _PathServiceServiceDescription();
2269 }
2270 return _cachedServiceDescription;
2271 }
2272 } 2329 }
2273 2330
2274 class PathServiceStub 2331 class PathServiceStub
2275 extends bindings.Stub<PathService> 2332 extends bindings.Stub<PathService>
2276 implements PathService { 2333 implements PathService,
2334 PathServiceInterface,
2335 PathServiceInterfaceRequest {
2336 PathServiceStub.unbound([PathService impl])
2337 : super(new _PathServiceStubControl.unbound(impl));
2338
2277 PathServiceStub.fromEndpoint( 2339 PathServiceStub.fromEndpoint(
2278 core.MojoMessagePipeEndpoint endpoint, [PathService impl]) 2340 core.MojoMessagePipeEndpoint endpoint, [PathService impl])
2279 : super(new _PathServiceStubControl.fromEndpoint(endpoint, impl)); 2341 : super(new _PathServiceStubControl.fromEndpoint(endpoint, impl));
2280 2342
2281 PathServiceStub.fromHandle( 2343 PathServiceStub.fromHandle(
2282 core.MojoHandle handle, [PathService impl]) 2344 core.MojoHandle handle, [PathService impl])
2283 : super(new _PathServiceStubControl.fromHandle(handle, impl)); 2345 : super(new _PathServiceStubControl.fromHandle(handle, impl));
2284 2346
2285 PathServiceStub.unbound([PathService impl])
2286 : super(new _PathServiceStubControl.unbound(impl));
2287
2288 static PathServiceStub newFromEndpoint( 2347 static PathServiceStub newFromEndpoint(
2289 core.MojoMessagePipeEndpoint endpoint) { 2348 core.MojoMessagePipeEndpoint endpoint) {
2290 assert(endpoint.setDescription("For PathServiceStub")); 2349 assert(endpoint.setDescription("For PathServiceStub"));
2291 return new PathServiceStub.fromEndpoint(endpoint); 2350 return new PathServiceStub.fromEndpoint(endpoint);
2292 } 2351 }
2293 2352
2294 static service_describer.ServiceDescription get serviceDescription =>
2295 _PathServiceStubControl.serviceDescription;
2296
2297 2353
2298 dynamic getAppDataDir([Function responseFactory = null]) { 2354 dynamic getAppDataDir([Function responseFactory = null]) {
2299 return impl.getAppDataDir(responseFactory); 2355 return impl.getAppDataDir(responseFactory);
2300 } 2356 }
2301 dynamic getFilesDir([Function responseFactory = null]) { 2357 dynamic getFilesDir([Function responseFactory = null]) {
2302 return impl.getFilesDir(responseFactory); 2358 return impl.getFilesDir(responseFactory);
2303 } 2359 }
2304 dynamic getCacheDir([Function responseFactory = null]) { 2360 dynamic getCacheDir([Function responseFactory = null]) {
2305 return impl.getCacheDir(responseFactory); 2361 return impl.getCacheDir(responseFactory);
2306 } 2362 }
2307 } 2363 }
2308 2364
2309 const int _userFeedbackMethodPerformHapticFeedbackName = 0; 2365 const int _userFeedbackMethodPerformHapticFeedbackName = 0;
2310 const int _userFeedbackMethodPerformAuralFeedbackName = 1; 2366 const int _userFeedbackMethodPerformAuralFeedbackName = 1;
2311 2367
2312 class _UserFeedbackServiceDescription implements service_describer.ServiceDescri ption { 2368 class _UserFeedbackServiceDescription implements service_describer.ServiceDescri ption {
2313 dynamic getTopLevelInterface([Function responseFactory]) => 2369 dynamic getTopLevelInterface([Function responseFactory]) =>
2314 responseFactory(null); 2370 responseFactory(null);
2315 2371
2316 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => 2372 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) =>
2317 responseFactory(null); 2373 responseFactory(null);
2318 2374
2319 dynamic getAllTypeDefinitions([Function responseFactory]) => 2375 dynamic getAllTypeDefinitions([Function responseFactory]) =>
2320 responseFactory(null); 2376 responseFactory(null);
2321 } 2377 }
2322 2378
2323 abstract class UserFeedback { 2379 abstract class UserFeedback {
2324 static const String serviceName = null; 2380 static const String serviceName = null;
2381
2382 static service_describer.ServiceDescription _cachedServiceDescription;
2383 static service_describer.ServiceDescription get serviceDescription {
2384 if (_cachedServiceDescription == null) {
2385 _cachedServiceDescription = new _UserFeedbackServiceDescription();
2386 }
2387 return _cachedServiceDescription;
2388 }
2389
2390 static UserFeedbackProxy connectToService(
2391 bindings.ServiceConnector s, String url, [String serviceName]) {
2392 UserFeedbackProxy p = new UserFeedbackProxy.unbound();
2393 String name = serviceName ?? UserFeedback.serviceName;
2394 if ((name == null) || name.isEmpty) {
2395 throw new core.MojoApiError(
2396 "If an interface has no ServiceName, then one must be provided.");
2397 }
2398 s.connectToService(url, p, name);
2399 return p;
2400 }
2325 void performHapticFeedback(HapticFeedbackType type); 2401 void performHapticFeedback(HapticFeedbackType type);
2326 void performAuralFeedback(AuralFeedbackType type); 2402 void performAuralFeedback(AuralFeedbackType type);
2327 } 2403 }
2328 2404
2405 abstract class UserFeedbackInterface
2406 implements bindings.MojoInterface<UserFeedback>,
2407 UserFeedback {
2408 factory UserFeedbackInterface([UserFeedback impl]) =>
2409 new UserFeedbackStub.unbound(impl);
2410 factory UserFeedbackInterface.fromEndpoint(
2411 core.MojoMessagePipeEndpoint endpoint,
2412 [UserFeedback impl]) =>
2413 new UserFeedbackStub.fromEndpoint(endpoint, impl);
2414 }
2415
2416 abstract class UserFeedbackInterfaceRequest
2417 implements bindings.MojoInterface<UserFeedback>,
2418 UserFeedback {
2419 factory UserFeedbackInterfaceRequest() =>
2420 new UserFeedbackProxy.unbound();
2421 }
2422
2329 class _UserFeedbackProxyControl 2423 class _UserFeedbackProxyControl
2330 extends bindings.ProxyMessageHandler 2424 extends bindings.ProxyMessageHandler
2331 implements bindings.ProxyControl { 2425 implements bindings.ProxyControl<UserFeedback> {
2332 _UserFeedbackProxyControl.fromEndpoint( 2426 _UserFeedbackProxyControl.fromEndpoint(
2333 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); 2427 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint);
2334 2428
2335 _UserFeedbackProxyControl.fromHandle( 2429 _UserFeedbackProxyControl.fromHandle(
2336 core.MojoHandle handle) : super.fromHandle(handle); 2430 core.MojoHandle handle) : super.fromHandle(handle);
2337 2431
2338 _UserFeedbackProxyControl.unbound() : super.unbound(); 2432 _UserFeedbackProxyControl.unbound() : super.unbound();
2339 2433
2340 service_describer.ServiceDescription get serviceDescription =>
2341 new _UserFeedbackServiceDescription();
2342
2343 String get serviceName => UserFeedback.serviceName; 2434 String get serviceName => UserFeedback.serviceName;
2344 2435
2345 void handleResponse(bindings.ServiceMessage message) { 2436 void handleResponse(bindings.ServiceMessage message) {
2346 switch (message.header.type) { 2437 switch (message.header.type) {
2347 default: 2438 default:
2348 proxyError("Unexpected message type: ${message.header.type}"); 2439 proxyError("Unexpected message type: ${message.header.type}");
2349 close(immediate: true); 2440 close(immediate: true);
2350 break; 2441 break;
2351 } 2442 }
2352 } 2443 }
2353 2444
2445 UserFeedback get impl => null;
2446 set impl(UserFeedback _) {
2447 throw new core.MojoApiError("The impl of a Proxy cannot be set.");
2448 }
2449
2354 @override 2450 @override
2355 String toString() { 2451 String toString() {
2356 var superString = super.toString(); 2452 var superString = super.toString();
2357 return "_UserFeedbackProxyControl($superString)"; 2453 return "_UserFeedbackProxyControl($superString)";
2358 } 2454 }
2359 } 2455 }
2360 2456
2361 class UserFeedbackProxy 2457 class UserFeedbackProxy
2362 extends bindings.Proxy 2458 extends bindings.Proxy<UserFeedback>
2363 implements UserFeedback { 2459 implements UserFeedback,
2460 UserFeedbackInterface,
2461 UserFeedbackInterfaceRequest {
2364 UserFeedbackProxy.fromEndpoint( 2462 UserFeedbackProxy.fromEndpoint(
2365 core.MojoMessagePipeEndpoint endpoint) 2463 core.MojoMessagePipeEndpoint endpoint)
2366 : super(new _UserFeedbackProxyControl.fromEndpoint(endpoint)); 2464 : super(new _UserFeedbackProxyControl.fromEndpoint(endpoint));
2367 2465
2368 UserFeedbackProxy.fromHandle(core.MojoHandle handle) 2466 UserFeedbackProxy.fromHandle(core.MojoHandle handle)
2369 : super(new _UserFeedbackProxyControl.fromHandle(handle)); 2467 : super(new _UserFeedbackProxyControl.fromHandle(handle));
2370 2468
2371 UserFeedbackProxy.unbound() 2469 UserFeedbackProxy.unbound()
2372 : super(new _UserFeedbackProxyControl.unbound()); 2470 : super(new _UserFeedbackProxyControl.unbound());
2373 2471
2374 static UserFeedbackProxy newFromEndpoint( 2472 static UserFeedbackProxy newFromEndpoint(
2375 core.MojoMessagePipeEndpoint endpoint) { 2473 core.MojoMessagePipeEndpoint endpoint) {
2376 assert(endpoint.setDescription("For UserFeedbackProxy")); 2474 assert(endpoint.setDescription("For UserFeedbackProxy"));
2377 return new UserFeedbackProxy.fromEndpoint(endpoint); 2475 return new UserFeedbackProxy.fromEndpoint(endpoint);
2378 } 2476 }
2379 2477
2380 factory UserFeedbackProxy.connectToService(
2381 bindings.ServiceConnector s, String url, [String serviceName]) {
2382 UserFeedbackProxy p = new UserFeedbackProxy.unbound();
2383 s.connectToService(url, p, serviceName);
2384 return p;
2385 }
2386
2387 2478
2388 void performHapticFeedback(HapticFeedbackType type) { 2479 void performHapticFeedback(HapticFeedbackType type) {
2389 if (!ctrl.isBound) { 2480 if (!ctrl.isBound) {
2390 ctrl.proxyError("The Proxy is closed."); 2481 ctrl.proxyError("The Proxy is closed.");
2391 return; 2482 return;
2392 } 2483 }
2393 var params = new _UserFeedbackPerformHapticFeedbackParams(); 2484 var params = new _UserFeedbackPerformHapticFeedbackParams();
2394 params.type = type; 2485 params.type = type;
2395 ctrl.sendMessage(params, 2486 ctrl.sendMessage(params,
2396 _userFeedbackMethodPerformHapticFeedbackName); 2487 _userFeedbackMethodPerformHapticFeedbackName);
(...skipping 22 matching lines...) Expand all
2419 } 2510 }
2420 2511
2421 _UserFeedbackStubControl.fromHandle( 2512 _UserFeedbackStubControl.fromHandle(
2422 core.MojoHandle handle, [UserFeedback impl]) 2513 core.MojoHandle handle, [UserFeedback impl])
2423 : super.fromHandle(handle, autoBegin: impl != null) { 2514 : super.fromHandle(handle, autoBegin: impl != null) {
2424 _impl = impl; 2515 _impl = impl;
2425 } 2516 }
2426 2517
2427 _UserFeedbackStubControl.unbound([this._impl]) : super.unbound(); 2518 _UserFeedbackStubControl.unbound([this._impl]) : super.unbound();
2428 2519
2520 String get serviceName => UserFeedback.serviceName;
2521
2429 2522
2430 2523
2431 dynamic handleMessage(bindings.ServiceMessage message) { 2524 dynamic handleMessage(bindings.ServiceMessage message) {
2432 if (bindings.ControlMessageHandler.isControlMessage(message)) { 2525 if (bindings.ControlMessageHandler.isControlMessage(message)) {
2433 return bindings.ControlMessageHandler.handleMessage(this, 2526 return bindings.ControlMessageHandler.handleMessage(this,
2434 0, 2527 0,
2435 message); 2528 message);
2436 } 2529 }
2437 if (_impl == null) { 2530 if (_impl == null) {
2438 throw new core.MojoApiError("$this has no implementation set"); 2531 throw new core.MojoApiError("$this has no implementation set");
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
2474 } 2567 }
2475 } 2568 }
2476 2569
2477 @override 2570 @override
2478 String toString() { 2571 String toString() {
2479 var superString = super.toString(); 2572 var superString = super.toString();
2480 return "_UserFeedbackStubControl($superString)"; 2573 return "_UserFeedbackStubControl($superString)";
2481 } 2574 }
2482 2575
2483 int get version => 0; 2576 int get version => 0;
2484
2485 static service_describer.ServiceDescription _cachedServiceDescription;
2486 static service_describer.ServiceDescription get serviceDescription {
2487 if (_cachedServiceDescription == null) {
2488 _cachedServiceDescription = new _UserFeedbackServiceDescription();
2489 }
2490 return _cachedServiceDescription;
2491 }
2492 } 2577 }
2493 2578
2494 class UserFeedbackStub 2579 class UserFeedbackStub
2495 extends bindings.Stub<UserFeedback> 2580 extends bindings.Stub<UserFeedback>
2496 implements UserFeedback { 2581 implements UserFeedback,
2582 UserFeedbackInterface,
2583 UserFeedbackInterfaceRequest {
2584 UserFeedbackStub.unbound([UserFeedback impl])
2585 : super(new _UserFeedbackStubControl.unbound(impl));
2586
2497 UserFeedbackStub.fromEndpoint( 2587 UserFeedbackStub.fromEndpoint(
2498 core.MojoMessagePipeEndpoint endpoint, [UserFeedback impl]) 2588 core.MojoMessagePipeEndpoint endpoint, [UserFeedback impl])
2499 : super(new _UserFeedbackStubControl.fromEndpoint(endpoint, impl)); 2589 : super(new _UserFeedbackStubControl.fromEndpoint(endpoint, impl));
2500 2590
2501 UserFeedbackStub.fromHandle( 2591 UserFeedbackStub.fromHandle(
2502 core.MojoHandle handle, [UserFeedback impl]) 2592 core.MojoHandle handle, [UserFeedback impl])
2503 : super(new _UserFeedbackStubControl.fromHandle(handle, impl)); 2593 : super(new _UserFeedbackStubControl.fromHandle(handle, impl));
2504 2594
2505 UserFeedbackStub.unbound([UserFeedback impl])
2506 : super(new _UserFeedbackStubControl.unbound(impl));
2507
2508 static UserFeedbackStub newFromEndpoint( 2595 static UserFeedbackStub newFromEndpoint(
2509 core.MojoMessagePipeEndpoint endpoint) { 2596 core.MojoMessagePipeEndpoint endpoint) {
2510 assert(endpoint.setDescription("For UserFeedbackStub")); 2597 assert(endpoint.setDescription("For UserFeedbackStub"));
2511 return new UserFeedbackStub.fromEndpoint(endpoint); 2598 return new UserFeedbackStub.fromEndpoint(endpoint);
2512 } 2599 }
2513 2600
2514 static service_describer.ServiceDescription get serviceDescription =>
2515 _UserFeedbackStubControl.serviceDescription;
2516
2517 2601
2518 void performHapticFeedback(HapticFeedbackType type) { 2602 void performHapticFeedback(HapticFeedbackType type) {
2519 return impl.performHapticFeedback(type); 2603 return impl.performHapticFeedback(type);
2520 } 2604 }
2521 void performAuralFeedback(AuralFeedbackType type) { 2605 void performAuralFeedback(AuralFeedbackType type) {
2522 return impl.performAuralFeedback(type); 2606 return impl.performAuralFeedback(type);
2523 } 2607 }
2524 } 2608 }
2525 2609
2526 2610
2527 2611
OLDNEW
« no previous file with comments | « mojo/dart/packages/mojo/sources.gni ('k') | mojo/dart/packages/mojo_services/lib/authentication/authentication.mojom.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698