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

Side by Side Diff: lib/google_signin.dart

Issue 1418513006: update elements and fix some bugs (Closed) Base URL: git@github.com:dart-lang/polymer_elements.git@master
Patch Set: code review updates Created 5 years, 1 month 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
« no previous file with comments | « lib/google_maps_api.dart ('k') | lib/google_signin_aware.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // DO NOT EDIT: auto-generated with `pub run custom_element_apigen:update` 1 // DO NOT EDIT: auto-generated with `pub run custom_element_apigen:update`
2 2
3 /// Dart API for the polymer element `google_signin`. 3 /// Dart API for the polymer element `google_signin`.
4 @HtmlImport('google_signin_nodart.html') 4 @HtmlImport('google_signin_nodart.html')
5 library polymer_elements.lib.src.google_signin.google_signin; 5 library polymer_elements.lib.src.google_signin.google_signin;
6 6
7 import 'dart:html'; 7 import 'dart:html';
8 import 'dart:js' show JsArray, JsObject; 8 import 'dart:js' show JsArray, JsObject;
9 import 'package:web_components/web_components.dart'; 9 import 'package:web_components/web_components.dart';
10 import 'package:polymer_interop/polymer_interop.dart'; 10 import 'package:polymer_interop/polymer_interop.dart';
(...skipping 29 matching lines...) Expand all
40 /// 40 ///
41 /// The `scopes` attribute allows you to specify which scope permissions are req uired 41 /// The `scopes` attribute allows you to specify which scope permissions are req uired
42 /// (e.g do you want to allow interaction with the Google Drive API). Many APIs also 42 /// (e.g do you want to allow interaction with the Google Drive API). Many APIs also
43 /// need to be enabled in the Google Developers Console before you can use them. 43 /// need to be enabled in the Google Developers Console before you can use them.
44 /// 44 ///
45 /// The `requestVisibleActions` attribute is necessary if you want to write app 45 /// The `requestVisibleActions` attribute is necessary if you want to write app
46 /// activities (https://developers.google.com/+/web/app-activities/) on behalf o f 46 /// activities (https://developers.google.com/+/web/app-activities/) on behalf o f
47 /// the user. Please note that this attribute is only valid in combination with the 47 /// the user. Please note that this attribute is only valid in combination with the
48 /// plus.login scope (https://www.googleapis.com/auth/plus.login). 48 /// plus.login scope (https://www.googleapis.com/auth/plus.login).
49 /// 49 ///
50 /// The `offline` attribute allows you to get an auth code which your server can
51 /// redeem for an offline access token
52 /// (https://developers.google.com/identity/sign-in/web/server-side-flow).
53 /// You can also set `offline-always-prompt` instead of `offline` to ensure that your app
54 /// will re-prompt the user for offline access and generate a working `refresh_t oken`
55 /// even if they have already granted offline access to your app in the past.
56 ///
50 /// Use label properties to customize prompts. 57 /// Use label properties to customize prompts.
51 /// 58 ///
52 /// The button can be styled in using the `height`, `width`, and `theme` attribu tes. 59 /// The button can be styled in using the `height`, `width`, and `theme` attribu tes.
53 /// These attributes help you follow the Google+ Sign-In button branding guideli nes 60 /// These attributes help you follow the Google+ Sign-In button branding guideli nes
54 /// (https://developers.google.com/+/branding-guidelines). 61 /// (https://developers.google.com/+/branding-guidelines).
55 /// 62 ///
56 /// The `google-signin-success` event is triggered when a user successfully auth enticates 63 /// The `google-signin-success` event is triggered when a user successfully auth enticates
57 /// and `google-signed-out` is triggered when user signeds out. 64 /// and `google-signed-out` is triggered when user signs out.
58 /// You can also use `isAuthorized` attribute to observe user's authentication s tate. 65 /// You can also use `isAuthorized` attribute to observe user's authentication s tate.
59 /// 66 ///
60 /// Additional events, such as `google-signout-attempted` are 67 /// Additional events, such as `google-signout-attempted` are
61 /// triggered when the user attempts to sign-out and successfully signs out. 68 /// triggered when the user attempts to sign-out and successfully signs out.
62 /// 69 ///
70 /// When requesting offline access, the `google-signin-offline-success` event is
71 /// triggered when the user successfully consents with offline support.
72 ///
63 /// The `google-signin-necessary` event is fired when scopes requested via 73 /// The `google-signin-necessary` event is fired when scopes requested via
64 /// google-signin-aware elements require additional user permissions. 74 /// google-signin-aware elements require additional user permissions.
65 /// 75 ///
66 /// #### Testing 76 /// #### Testing
67 /// 77 ///
68 /// By default, the demo accompanying this element is setup to work on localhost with 78 /// By default, the demo accompanying this element is setup to work on localhost with
69 /// port 8080. That said, you *should* update the `clientId` to your own one for 79 /// port 8080. That said, you *should* update the `clientId` to your own one for
70 /// any apps you're building. See the Google Developers Console 80 /// any apps you're building. See the Google Developers Console
71 /// (https://console.developers.google.com) for more info. 81 /// (https://console.developers.google.com) for more info.
72 @CustomElementProxy('google-signin') 82 @CustomElementProxy('google-signin')
(...skipping 28 matching lines...) Expand all
101 /// True if *any* element has google+ scopes 111 /// True if *any* element has google+ scopes
102 bool get hasPlusScopes => jsElement[r'hasPlusScopes']; 112 bool get hasPlusScopes => jsElement[r'hasPlusScopes'];
103 set hasPlusScopes(bool value) { jsElement[r'hasPlusScopes'] = value; } 113 set hasPlusScopes(bool value) { jsElement[r'hasPlusScopes'] = value; }
104 114
105 /// The height to use for the button. 115 /// The height to use for the button.
106 /// 116 ///
107 /// Available options: short, standard, tall. 117 /// Available options: short, standard, tall.
108 get height => jsElement[r'height']; 118 get height => jsElement[r'height'];
109 set height(value) { jsElement[r'height'] = (value is Map || (value is Iterable && value is! JsArray)) ? new JsObject.jsify(value) : value;} 119 set height(value) { jsElement[r'height'] = (value is Map || (value is Iterable && value is! JsArray)) ? new JsObject.jsify(value) : value;}
110 120
121 /// The Google Apps domain to which users must belong to sign in.
122 /// See the relevant [docs](https://developers.google.com/identity/sign-in/web /reference) for more information.
123 String get hostedDomain => jsElement[r'hostedDomain'];
124 set hostedDomain(String value) { jsElement[r'hostedDomain'] = value; }
125
111 /// True if authorizations for *this* element have been granted 126 /// True if authorizations for *this* element have been granted
112 bool get isAuthorized => jsElement[r'isAuthorized']; 127 bool get isAuthorized => jsElement[r'isAuthorized'];
113 set isAuthorized(bool value) { jsElement[r'isAuthorized'] = value; } 128 set isAuthorized(bool value) { jsElement[r'isAuthorized'] = value; }
114 129
115 /// An optional label for the button for additional permissions. 130 /// An optional label for the button for additional permissions.
116 String get labelAdditional => jsElement[r'labelAdditional']; 131 String get labelAdditional => jsElement[r'labelAdditional'];
117 set labelAdditional(String value) { jsElement[r'labelAdditional'] = value; } 132 set labelAdditional(String value) { jsElement[r'labelAdditional'] = value; }
118 133
119 /// An optional label for the sign-in button. 134 /// An optional label for the sign-in button.
120 String get labelSignin => jsElement[r'labelSignin']; 135 String get labelSignin => jsElement[r'labelSignin'];
121 set labelSignin(String value) { jsElement[r'labelSignin'] = value; } 136 set labelSignin(String value) { jsElement[r'labelSignin'] = value; }
122 137
123 /// An optional label for the sign-out button. 138 /// An optional label for the sign-out button.
124 String get labelSignout => jsElement[r'labelSignout']; 139 String get labelSignout => jsElement[r'labelSignout'];
125 set labelSignout(String value) { jsElement[r'labelSignout'] = value; } 140 set labelSignout(String value) { jsElement[r'labelSignout'] = value; }
126 141
127 /// True if additional authorization required globally 142 /// True if additional authorization required globally
128 bool get needAdditionalAuth => jsElement[r'needAdditionalAuth']; 143 bool get needAdditionalAuth => jsElement[r'needAdditionalAuth'];
129 set needAdditionalAuth(bool value) { jsElement[r'needAdditionalAuth'] = value; } 144 set needAdditionalAuth(bool value) { jsElement[r'needAdditionalAuth'] = value; }
130 145
146 /// Allows for offline `access_token` retrieval during the signin process.
147 bool get offline => jsElement[r'offline'];
148 set offline(bool value) { jsElement[r'offline'] = value; }
149
150 /// Forces a re-prompt, even if the user has already granted offline
151 /// access to your application in the past. You only need one of
152 /// `offline` and `offlineAlwaysPrompt`.
153 bool get offlineAlwaysPrompt => jsElement[r'offlineAlwaysPrompt'];
154 set offlineAlwaysPrompt(bool value) { jsElement[r'offlineAlwaysPrompt'] = valu e; }
155
131 /// If true, the button will be styled with a shadow. 156 /// If true, the button will be styled with a shadow.
132 bool get raised => jsElement[r'raised']; 157 bool get raised => jsElement[r'raised'];
133 set raised(bool value) { jsElement[r'raised'] = value; } 158 set raised(bool value) { jsElement[r'raised'] = value; }
134 159
135 /// The app activity types you want to write on behalf of the user 160 /// The app activity types you want to write on behalf of the user
136 /// (e.g http://schemas.google.com/AddActivity) 161 /// (e.g http://schemas.google.com/AddActivity)
137 String get requestVisibleActions => jsElement[r'requestVisibleActions']; 162 String get requestVisibleActions => jsElement[r'requestVisibleActions'];
138 set requestVisibleActions(String value) { jsElement[r'requestVisibleActions'] = value; } 163 set requestVisibleActions(String value) { jsElement[r'requestVisibleActions'] = value; }
139 164
140 /// The scopes to provide access to (e.g https://www.googleapis.com/auth/drive ) 165 /// The scopes to provide access to (e.g https://www.googleapis.com/auth/drive )
(...skipping 19 matching lines...) Expand all
160 185
161 /// Sign in user. Opens the authorization dialog for signing in. 186 /// Sign in user. Opens the authorization dialog for signing in.
162 /// The dialog will be blocked by a popup blocker unless called inside click h andler. 187 /// The dialog will be blocked by a popup blocker unless called inside click h andler.
163 signIn() => 188 signIn() =>
164 jsElement.callMethod('signIn', []); 189 jsElement.callMethod('signIn', []);
165 190
166 /// Sign out the user 191 /// Sign out the user
167 signOut() => 192 signOut() =>
168 jsElement.callMethod('signOut', []); 193 jsElement.callMethod('signOut', []);
169 } 194 }
OLDNEW
« no previous file with comments | « lib/google_maps_api.dart ('k') | lib/google_signin_aware.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698