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

Unified Diff: chrome/browser/extensions/api/messaging/arc_support_host.cc

Issue 1847463002: arc: Use v2/auth LSO page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
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 {
« no previous file with comments | « chrome/browser/chromeos/arc/arc_auth_service_unittest.cc ('k') | chrome/browser/resources/chromeos/arc_support/background.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698