Chromium Code Reviews| Index: chrome/browser/chromeos/arc/arc_support_host.cc |
| diff --git a/chrome/browser/chromeos/arc/arc_support_host.cc b/chrome/browser/chromeos/arc/arc_support_host.cc |
| index 794a0c51bdbe9c5cbfabe1f281b7d9c3b215ff6f..f2ce3a6d697c45c226cd4b4774a954e063ad12df 100644 |
| --- a/chrome/browser/chromeos/arc/arc_support_host.cc |
| +++ b/chrome/browser/chromeos/arc/arc_support_host.cc |
| @@ -29,7 +29,6 @@ constexpr char kAction[] = "action"; |
| constexpr char kArcManaged[] = "arcManaged"; |
| constexpr char kData[] = "data"; |
| constexpr char kDeviceId[] = "deviceId"; |
| -constexpr char kPage[] = "page"; |
| constexpr char kStatus[] = "status"; |
|
hidehiko
2016/11/04 22:28:38
Oops, I didn't hit this locally, and this was hidd
|
| constexpr char kActionInitialize[] = "initialize"; |
| constexpr char kActionSetMetricsMode[] = "setMetricsMode"; |
| @@ -37,7 +36,17 @@ constexpr char kActionBackupAndRestoreMode[] = "setBackupAndRestoreMode"; |
| constexpr char kActionLocationServiceMode[] = "setLocationServiceMode"; |
| constexpr char kActionSetWindowBounds[] = "setWindowBounds"; |
| constexpr char kActionCloseWindow[] = "closeWindow"; |
| + |
| +// Action to show a page. The message should have "page" field, which is one of |
| +// IDs for section div elements. |
| constexpr char kActionShowPage[] = "showPage"; |
| +constexpr char kPage[] = "page"; |
| + |
| +// Action to show the error page. The message should have "errorMessage", |
| +// which is a localized error text, and "shouldShowSendFeedback" boolean value. |
| +constexpr char kActionShowErrorPage[] = "showErrorPage"; |
| +constexpr char kErrorMessage[] = "errorMessage"; |
| +constexpr char kShouldShowSendFeedback[] = "shouldShowSendFeedback"; |
| // The preference update should have those two fields. |
| constexpr char kEnabled[] = "enabled"; |
| @@ -118,9 +127,35 @@ void ArcSupportHost::ShowPage(arc::ArcAuthService::UIPage page, |
| } |
| base::DictionaryValue message; |
| - message.SetString(kAction, kActionShowPage); |
| - message.SetInteger(kPage, static_cast<int>(page)); |
| - message.SetString(kStatus, status); |
| + if (page == arc::ArcAuthService::UIPage::ERROR || |
| + page == arc::ArcAuthService::UIPage::ERROR_WITH_FEEDBACK) { |
| + message.SetString(kAction, kActionShowErrorPage); |
| + message.SetString(kErrorMessage, status); |
| + message.SetBoolean( |
| + kShouldShowSendFeedback, |
| + page == arc::ArcAuthService::UIPage::ERROR_WITH_FEEDBACK); |
| + } else { |
| + message.SetString(kAction, kActionShowPage); |
| + switch (page) { |
| + case arc::ArcAuthService::UIPage::NO_PAGE: |
| + message.SetString(kPage, "none"); |
| + break; |
| + case arc::ArcAuthService::UIPage::TERMS: |
| + message.SetString(kPage, "terms"); |
| + break; |
| + case arc::ArcAuthService::UIPage::LSO_PROGRESS: |
| + message.SetString(kPage, "lso-loading"); |
| + break; |
| + // Skip LSO. LSO and LSO_LOADING should be merged well. |
| + // TODO(hidehiko): Do it. |
| + case arc::ArcAuthService::UIPage::START_PROGRESS: |
| + message.SetString(kPage, "arc-loading"); |
| + break; |
| + default: |
| + NOTREACHED(); |
| + return; |
| + } |
| + } |
| message_host_->SendMessage(message); |
| } |