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..3c4fa82c88312d6b321b76d81a566bc5efdddef0 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"; |
| 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 an error message. The message should have "errorMessage", |
| +// which is a localized error text, and "showSendFeedback" boolean value. |
|
Luis Héctor Chávez
2016/11/04 17:11:25
nit: s/an error message/the error page/.
hidehiko
2016/11/04 17:49:49
Done.
|
| +constexpr char kActionShowErrorPage[] = "showErrorPage"; |
| +constexpr char kErrorMessage[] = "errorMessage"; |
| +constexpr char kShowSendFeedback[] = "showSendFeedback"; |
|
xiyuan
2016/11/04 16:52:40
nit: showSendFeedback -> shouldShowSendFeedback
s
hidehiko
2016/11/04 17:49:49
Done.
|
| // 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 || |
|
hidehiko
2016/11/04 01:23:46
Note: we'll split ShowPage() into two for the API
|
| + page == arc::ArcAuthService::UIPage::ERROR_WITH_FEEDBACK) { |
| + message.SetString(kAction, kActionShowErrorPage); |
| + message.SetString(kErrorMessage, status); |
| + message.SetBoolean( |
| + kShowSendFeedback, |
| + 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); |
| } |