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 3713eb058dab9ea26329320fbb9e032a40d6dcb9..5b0ee1a4caf0d009aeb9d78aa7e5bb0305393e41 100644 |
--- a/chrome/browser/chromeos/arc/arc_support_host.cc |
+++ b/chrome/browser/chromeos/arc/arc_support_host.cc |
@@ -19,6 +19,7 @@ |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/browser/ui/ash/multi_user/multi_user_util.h" |
#include "chrome/browser/ui/browser_commands.h" |
+#include "chrome/common/pref_names.h" |
#include "chrome/grit/generated_resources.h" |
#include "components/metrics/metrics_pref_names.h" |
#include "components/prefs/pref_service.h" |
@@ -43,6 +44,7 @@ const char kActionCancelAuthCode[] = "cancelAuthCode"; |
const char kActionSetAuthCode[] = "setAuthCode"; |
const char kActionEnableMetrics[] = "enableMetrics"; |
const char kActionSendFeedback[] = "sendFeedback"; |
+const char kActionEnableBackupRestore[] = "enableBackupRestore"; |
const char kActionCloseUI[] = "closeUI"; |
const char kActionShowPage[] = "showPage"; |
} // namespace |
@@ -98,7 +100,6 @@ void ArcSupportHost::Start(Client* client) { |
void ArcSupportHost::Initialize() { |
DCHECK(client_); |
- |
std::unique_ptr<base::DictionaryValue> localized_strings( |
new base::DictionaryValue()); |
base::string16 device_name = ash::GetChromeOSDeviceName(); |
@@ -133,6 +134,9 @@ void ArcSupportHost::Initialize() { |
localized_strings->SetString( |
"termsOfService", |
l10n_util::GetStringUTF16(IDS_ARC_OPT_IN_DIALOG_TERMS_OF_SERVICE)); |
+ localized_strings->SetString( |
+ "textBackupRestore", |
+ l10n_util::GetStringUTF16(IDS_ARC_OPT_IN_DIALOG_BACKUP_RESTORE)); |
const std::string& app_locale = g_browser_process->GetApplicationLocale(); |
const std::string& country_code = base::CountryCodeForCurrentTimezone(); |
@@ -219,6 +223,11 @@ void ArcSupportHost::EnableMetrics() { |
InitiateMetricsReportingChange(true, OnMetricsReportingCallbackType()); |
} |
+void ArcSupportHost::EnableBackupRestore() { |
+ PrefService* pref_service = arc::ArcAuthService::Get()->profile()->GetPrefs(); |
+ pref_service->SetBoolean(prefs::kArcBackupRestoreEnabled, true); |
+} |
+ |
void ArcSupportHost::OnMessage(const std::string& request_string) { |
std::unique_ptr<base::Value> request_value = |
base::JSONReader::Read(request_string); |
@@ -252,6 +261,8 @@ void ArcSupportHost::OnMessage(const std::string& request_string) { |
EnableMetrics(); |
} else if (action == kActionSendFeedback) { |
chrome::OpenFeedbackDialog(nullptr); |
+ } else if (action == kActionEnableBackupRestore) { |
+ EnableBackupRestore(); |
} else { |
NOTREACHED(); |
} |