| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chromeos/arc/arc_support_host.h" | 5 #include "chrome/browser/chromeos/arc/arc_support_host.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "ash/common/system/chromeos/devicetype_utils.h" | 9 #include "ash/common/system/chromeos/devicetype_utils.h" |
| 10 #include "base/i18n/timezone.h" | 10 #include "base/i18n/timezone.h" |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 base::DictionaryValue response; | 258 base::DictionaryValue response; |
| 259 response.SetString(kAction, kActionShowPage); | 259 response.SetString(kAction, kActionShowPage); |
| 260 response.SetInteger(kPage, static_cast<int>(page)); | 260 response.SetInteger(kPage, static_cast<int>(page)); |
| 261 response.SetString(kStatus, status); | 261 response.SetString(kStatus, status); |
| 262 std::string response_string; | 262 std::string response_string; |
| 263 base::JSONWriter::Write(response, &response_string); | 263 base::JSONWriter::Write(response, &response_string); |
| 264 client_->PostMessageFromNativeHost(response_string); | 264 client_->PostMessageFromNativeHost(response_string); |
| 265 } | 265 } |
| 266 | 266 |
| 267 void ArcSupportHost::EnableMetrics(bool is_enabled) { | 267 void ArcSupportHost::EnableMetrics(bool is_enabled) { |
| 268 InitiateMetricsReportingChange(is_enabled, OnMetricsReportingCallbackType()); | 268 ChangeMetricsReportingState(is_enabled); |
| 269 } | 269 } |
| 270 | 270 |
| 271 void ArcSupportHost::EnableBackupRestore(bool is_enabled) { | 271 void ArcSupportHost::EnableBackupRestore(bool is_enabled) { |
| 272 arc::ArcAuthService* arc_auth_service = arc::ArcAuthService::Get(); | 272 arc::ArcAuthService* arc_auth_service = arc::ArcAuthService::Get(); |
| 273 DCHECK(arc_auth_service && arc_auth_service->IsAllowed()); | 273 DCHECK(arc_auth_service && arc_auth_service->IsAllowed()); |
| 274 PrefService* pref_service = arc_auth_service->profile()->GetPrefs(); | 274 PrefService* pref_service = arc_auth_service->profile()->GetPrefs(); |
| 275 pref_service->SetBoolean(prefs::kArcBackupRestoreEnabled, is_enabled); | 275 pref_service->SetBoolean(prefs::kArcBackupRestoreEnabled, is_enabled); |
| 276 } | 276 } |
| 277 | 277 |
| 278 void ArcSupportHost::EnableLocationService(bool is_enabled) { | 278 void ArcSupportHost::EnableLocationService(bool is_enabled) { |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 EnableLocationService(is_enabled); | 336 EnableLocationService(is_enabled); |
| 337 } else { | 337 } else { |
| 338 NOTREACHED(); | 338 NOTREACHED(); |
| 339 } | 339 } |
| 340 } | 340 } |
| 341 | 341 |
| 342 scoped_refptr<base::SingleThreadTaskRunner> ArcSupportHost::task_runner() | 342 scoped_refptr<base::SingleThreadTaskRunner> ArcSupportHost::task_runner() |
| 343 const { | 343 const { |
| 344 return base::ThreadTaskRunnerHandle::Get(); | 344 return base::ThreadTaskRunnerHandle::Get(); |
| 345 } | 345 } |
| OLD | NEW |