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

Side by Side Diff: chrome/browser/chromeos/arc/arc_support_host.cc

Issue 2127113002: Policy to control ARC Backup&Restore. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: lhchavez comments. Created 4 years, 5 months 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 unified diff | Download patch
OLDNEW
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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 base::JSONWriter::Write(response, &response_string); 243 base::JSONWriter::Write(response, &response_string);
244 client_->PostMessageFromNativeHost(response_string); 244 client_->PostMessageFromNativeHost(response_string);
245 } 245 }
246 246
247 void ArcSupportHost::EnableMetrics(bool is_enabled) { 247 void ArcSupportHost::EnableMetrics(bool is_enabled) {
248 InitiateMetricsReportingChange(is_enabled, OnMetricsReportingCallbackType()); 248 InitiateMetricsReportingChange(is_enabled, OnMetricsReportingCallbackType());
249 } 249 }
250 250
251 void ArcSupportHost::EnableBackupRestore(bool is_enabled) { 251 void ArcSupportHost::EnableBackupRestore(bool is_enabled) {
252 PrefService* pref_service = arc::ArcAuthService::Get()->profile()->GetPrefs(); 252 PrefService* pref_service = arc::ArcAuthService::Get()->profile()->GetPrefs();
253 if (pref_service->IsManagedPreference(prefs::kArcBackupRestoreEnabled))
bartfab (slow) 2016/07/19 13:55:52 It is safe to set the pref value even when it is m
Sergey Poromov 2016/07/19 14:34:28 Done.
254 return;
253 pref_service->SetBoolean(prefs::kArcBackupRestoreEnabled, is_enabled); 255 pref_service->SetBoolean(prefs::kArcBackupRestoreEnabled, is_enabled);
254 } 256 }
255 257
256 void ArcSupportHost::OnMessage(const std::string& request_string) { 258 void ArcSupportHost::OnMessage(const std::string& request_string) {
257 std::unique_ptr<base::Value> request_value = 259 std::unique_ptr<base::Value> request_value =
258 base::JSONReader::Read(request_string); 260 base::JSONReader::Read(request_string);
259 base::DictionaryValue* request; 261 base::DictionaryValue* request;
260 if (!request_value || !request_value->GetAsDictionary(&request)) { 262 if (!request_value || !request_value->GetAsDictionary(&request)) {
261 NOTREACHED(); 263 NOTREACHED();
262 return; 264 return;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 EnableBackupRestore(is_enabled); 302 EnableBackupRestore(is_enabled);
301 } else { 303 } else {
302 NOTREACHED(); 304 NOTREACHED();
303 } 305 }
304 } 306 }
305 307
306 scoped_refptr<base::SingleThreadTaskRunner> ArcSupportHost::task_runner() 308 scoped_refptr<base::SingleThreadTaskRunner> ArcSupportHost::task_runner()
307 const { 309 const {
308 return base::ThreadTaskRunnerHandle::Get(); 310 return base::ThreadTaskRunnerHandle::Get();
309 } 311 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698