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

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

Issue 2225933002: Suppress ToS and reflect admin policy in ARC++ welcome screen (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add OS_CHROMEOS checks Created 4 years, 4 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 13 matching lines...) Expand all
24 #include "components/metrics/metrics_pref_names.h" 24 #include "components/metrics/metrics_pref_names.h"
25 #include "components/prefs/pref_service.h" 25 #include "components/prefs/pref_service.h"
26 #include "components/user_manager/known_user.h" 26 #include "components/user_manager/known_user.h"
27 #include "ui/base/l10n/l10n_util.h" 27 #include "ui/base/l10n/l10n_util.h"
28 #include "ui/base/webui/web_ui_util.h" 28 #include "ui/base/webui/web_ui_util.h"
29 #include "ui/display/screen.h" 29 #include "ui/display/screen.h"
30 30
31 namespace { 31 namespace {
32 const char kAction[] = "action"; 32 const char kAction[] = "action";
33 const char kBackupRestoreEnabled[] = "backupRestoreEnabled"; 33 const char kBackupRestoreEnabled[] = "backupRestoreEnabled";
34 const char kBackupRestoreManaged[] = "backupRestoreManaged";
34 const char kLocationServiceEnabled[] = "locationServiceEnabled"; 35 const char kLocationServiceEnabled[] = "locationServiceEnabled";
36 const char kLocationServiceManaged[] = "locationServiceManaged";
37 const char kProfileManaged[] = "profileManaged";
35 const char kCanEnable[] = "canEnable"; 38 const char kCanEnable[] = "canEnable";
36 const char kCode[] = "code"; 39 const char kCode[] = "code";
37 const char kData[] = "data"; 40 const char kData[] = "data";
38 const char kDeviceId[] = "deviceId"; 41 const char kDeviceId[] = "deviceId";
39 const char kEnabled[] = "enabled"; 42 const char kEnabled[] = "enabled";
40 const char kOn[] = "on"; 43 const char kOn[] = "on";
41 const char kPage[] = "page"; 44 const char kPage[] = "page";
42 const char kStatus[] = "status"; 45 const char kStatus[] = "status";
43 const char kText[] = "text"; 46 const char kText[] = "text";
44 const char kActionInitialize[] = "initialize"; 47 const char kActionInitialize[] = "initialize";
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 l10n_util::GetStringUTF16(IDS_ARC_OPT_IN_DIALOG_TERMS_OF_SERVICE)); 158 l10n_util::GetStringUTF16(IDS_ARC_OPT_IN_DIALOG_TERMS_OF_SERVICE));
156 loadtime_data->SetString( 159 loadtime_data->SetString(
157 "textBackupRestore", 160 "textBackupRestore",
158 l10n_util::GetStringUTF16(IDS_ARC_OPT_IN_DIALOG_BACKUP_RESTORE)); 161 l10n_util::GetStringUTF16(IDS_ARC_OPT_IN_DIALOG_BACKUP_RESTORE));
159 loadtime_data->SetString( 162 loadtime_data->SetString(
160 "textLocationService", 163 "textLocationService",
161 l10n_util::GetStringUTF16(IDS_ARC_OPT_IN_LOCATION_SETTING)); 164 l10n_util::GetStringUTF16(IDS_ARC_OPT_IN_LOCATION_SETTING));
162 loadtime_data->SetString( 165 loadtime_data->SetString(
163 "serverError", 166 "serverError",
164 l10n_util::GetStringUTF16(IDS_ARC_SERVER_COMMUNICATION_ERROR)); 167 l10n_util::GetStringUTF16(IDS_ARC_SERVER_COMMUNICATION_ERROR));
168 loadtime_data->SetString(
169 "managementText",
170 l10n_util::GetStringUTF16(IDS_OPTIONS_CONTROLLED_SETTING_POLICY));
165 171
166 const std::string& app_locale = g_browser_process->GetApplicationLocale(); 172 const std::string& app_locale = g_browser_process->GetApplicationLocale();
167 const std::string& country_code = base::CountryCodeForCurrentTimezone(); 173 const std::string& country_code = base::CountryCodeForCurrentTimezone();
168 loadtime_data->SetString("countryCode", country_code); 174 loadtime_data->SetString("countryCode", country_code);
169 175
170 loadtime_data->SetBoolean(kBackupRestoreEnabled, 176 loadtime_data->SetBoolean(kBackupRestoreEnabled,
171 arc_auth_service->profile()->GetPrefs()->GetBoolean( 177 arc_auth_service->profile()->GetPrefs()->GetBoolean(
172 prefs::kArcBackupRestoreEnabled)); 178 prefs::kArcBackupRestoreEnabled));
179 loadtime_data->SetBoolean(kBackupRestoreManaged,
180 arc_auth_service->profile()->GetPrefs()
181 ->IsManagedPreference(
182 prefs::kArcBackupRestoreEnabled));
173 loadtime_data->SetBoolean(kLocationServiceEnabled, 183 loadtime_data->SetBoolean(kLocationServiceEnabled,
174 arc_auth_service->profile()->GetPrefs()->GetBoolean( 184 arc_auth_service->profile()->GetPrefs()->GetBoolean(
175 prefs::kArcLocationServiceEnabled)); 185 prefs::kArcLocationServiceEnabled));
186 loadtime_data->SetBoolean(kLocationServiceManaged,
187 arc_auth_service->profile()->GetPrefs()
188 ->IsManagedPreference(
189 prefs::kArcLocationServiceEnabled));
190 loadtime_data->SetBoolean(kProfileManaged,
191 arc::ArcAuthService::IsAccountManaged(
192 arc_auth_service->profile()));
176 193
177 webui::SetLoadTimeDataDefaults(app_locale, loadtime_data.get()); 194 webui::SetLoadTimeDataDefaults(app_locale, loadtime_data.get());
178 DCHECK(arc_auth_service); 195 DCHECK(arc_auth_service);
179 const std::string device_id = user_manager::known_user::GetDeviceId( 196 const std::string device_id = user_manager::known_user::GetDeviceId(
180 multi_user_util::GetAccountIdFromProfile(arc_auth_service->profile())); 197 multi_user_util::GetAccountIdFromProfile(arc_auth_service->profile()));
181 DCHECK(!device_id.empty()); 198 DCHECK(!device_id.empty());
182 199
183 base::DictionaryValue request; 200 base::DictionaryValue request;
184 std::string request_string; 201 std::string request_string;
185 request.SetString(kAction, kActionInitialize); 202 request.SetString(kAction, kActionInitialize);
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 EnableLocationService(is_enabled); 353 EnableLocationService(is_enabled);
337 } else { 354 } else {
338 NOTREACHED(); 355 NOTREACHED();
339 } 356 }
340 } 357 }
341 358
342 scoped_refptr<base::SingleThreadTaskRunner> ArcSupportHost::task_runner() 359 scoped_refptr<base::SingleThreadTaskRunner> ArcSupportHost::task_runner()
343 const { 360 const {
344 return base::ThreadTaskRunnerHandle::Get(); 361 return base::ThreadTaskRunnerHandle::Get();
345 } 362 }
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/arc/arc_auth_service.cc ('k') | chrome/browser/policy/configuration_policy_handler_list_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698