Index: remoting/webapp/background/it2me_helpee_channel.js |
diff --git a/remoting/webapp/background/it2me_helpee_channel.js b/remoting/webapp/background/it2me_helpee_channel.js |
index 94001883bbbbed43d4b417d0d03214d8e3ef916d..6c9453b7c8b53ff1bdda2cd356275f3e7f102716 100644 |
--- a/remoting/webapp/background/it2me_helpee_channel.js |
+++ b/remoting/webapp/background/it2me_helpee_channel.js |
@@ -280,23 +280,39 @@ remoting.It2MeHelpeeChannel.prototype.handleConnect_ = |
* @private |
*/ |
remoting.It2MeHelpeeChannel.prototype.showConfirmDialog_ = function() { |
- /** |
- * @param {function(*=):void} resolve |
- * @param {function(*=):void} reject |
- */ |
- return new Promise(function(resolve, reject) { |
- // TODO(kelvinp): The existing implementation doesn't work in the v2 app as |
- // window.confirm is blacklisted. Implement the dialog using |
- // chrome.app.window instead (crbug.com/405139). |
- if (base.isAppsV2()) { |
- resolve(); |
- // The unlocalized string will be replaced in (crbug.com/405139). |
- } else if (window.confirm('Accept help?')) { |
- resolve(); |
- } else { |
- reject(new Error(remoting.Error.CANCELLED)); |
- } |
- }); |
+ var message = l10n.getTranslationOrError( |
+ /*i18n-content*/'HANGOUTS_CONFIRM_DIALOG_MESSAGE'); |
+ |
+ if (base.isAppsV2()) { |
+ /** |
+ * @param {function(*=):void} resolve |
+ * @param {function(*=):void} reject |
+ */ |
+ return new Promise(function(resolve, reject) { |
+ /** @param {number} result */ |
+ function confirmDialogCallback(result) { |
+ if (result === 1) { |
+ resolve(); |
+ } else { |
+ reject(new Error(remoting.Error.CANCELLED)); |
+ } |
+ } |
+ |
+ remoting.MessageWindow.showConfirmWindow( |
+ '', // Empty string to use the package name as the dialog title. |
+ message, |
+ l10n.getTranslationOrError( |
+ /*i18n-content*/'HANGOUTS_CONFIRM_DIALOG_ACCEPT'), |
+ l10n.getTranslationOrError( |
+ /*i18n-content*/'HANGOUTS_CONFIRM_DIALOG_DECLINE'), |
+ confirmDialogCallback |
+ ); |
+ }); |
+ } else if (window.confirm(message)) { |
+ return Promise.resolve(); |
+ } else { |
+ return Promise.reject(new Error(remoting.Error.CANCELLED)); |
+ } |
}; |
/** |