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

Unified Diff: chrome/browser/chromeos/arc/arc_support_host.cc

Issue 2479633004: Split ShowPage message into two. (Closed)
Patch Set: Fix compile error. Created 4 years, 1 month 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
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/arc_support/background.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..d2e519bd172c3d25fa88fded5427017f9b1ca5fe 100644
--- a/chrome/browser/chromeos/arc/arc_support_host.cc
+++ b/chrome/browser/chromeos/arc/arc_support_host.cc
@@ -29,15 +29,23 @@ 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";
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 +126,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);
}
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/arc_support/background.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698