Index: chrome/browser/extensions/api/messaging/arc_support_host.cc |
diff --git a/chrome/browser/extensions/api/messaging/arc_support_host.cc b/chrome/browser/extensions/api/messaging/arc_support_host.cc |
index e78cedeba322c0db51ca2dcff8b22990a0341e4e..ea537694efaeb51bc0fdc04c1e57aa32497b90be 100644 |
--- a/chrome/browser/extensions/api/messaging/arc_support_host.cc |
+++ b/chrome/browser/extensions/api/messaging/arc_support_host.cc |
@@ -16,12 +16,14 @@ |
namespace { |
const char kAction[] = "action"; |
+const char kCode[] = "code"; |
const char kStatus[] = "status"; |
const char kData[] = "data"; |
const char kPage[] = "page"; |
const char kActionSetLocalization[] = "setLocalization"; |
-const char kActionCheckAuthCode[] = "checkAuthCode"; |
+const char kActionStartLSO[] = "startLSO"; |
Sergey Ulanov
2016/03/31 17:24:23
nit: Suggest calling these startLso and kActionSta
khmel
2016/03/31 18:02:31
Thanks for sharing this, this makes sense. Noted f
|
const char kActionCancelAuthCode[] = "cancelAuthCode"; |
+const char kActionSetAuthCode[] = "setAuthCode"; |
const char kActionCloseUI[] = "closeUI"; |
const char kActionShowPage[] = "showPage"; |
} // namespace |
@@ -85,6 +87,9 @@ void ArcSupportHost::SendLocalization() { |
localized_strings->SetString( |
"progressAndroidLoading", |
l10n_util::GetStringUTF16(IDS_ARC_OPT_IN_DIALOG_PROGRESS_ANDROID)); |
+ localized_strings->SetString( |
+ "authorizationFailed", |
+ l10n_util::GetStringUTF16(IDS_ARC_OPT_IN_DIALOG_AUTHORIZATION_FAILED)); |
const std::string& app_locale = g_browser_process->GetApplicationLocale(); |
webui::SetLoadTimeDataDefaults(app_locale, localized_strings.get()); |
@@ -138,8 +143,15 @@ void ArcSupportHost::OnMessage(const std::string& request_string) { |
return; |
} |
- if (action == kActionCheckAuthCode) { |
- arc::ArcAuthService::Get()->CheckAuthCode(); |
+ if (action == kActionStartLSO) { |
+ arc::ArcAuthService::Get()->StartLSO(); |
Sergey Ulanov
2016/03/31 17:24:23
nit: StartLso()
khmel
2016/03/31 18:02:31
Done.
|
+ } else if (action == kActionSetAuthCode) { |
+ std::string code; |
+ if (!request->GetString(kCode, &code)) { |
+ NOTREACHED(); |
+ return; |
+ } |
+ arc::ArcAuthService::Get()->SetAuthCodeAndStartArc(code); |
} else if (action == kActionCancelAuthCode) { |
arc::ArcAuthService::Get()->CancelAuthCode(); |
} else { |