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

Side by Side Diff: chrome/browser/chromeos/login/wizard_controller.cc

Issue 7480040: Rewire the metrics pref to the signed settings store on chromeos. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased to ToT. Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/login/wizard_controller.h" 5 #include "chrome/browser/chromeos/login/wizard_controller.h"
6 6
7 #include <gdk/gdk.h> 7 #include <gdk/gdk.h>
8 #include <signal.h> 8 #include <signal.h>
9 #include <sys/types.h> 9 #include <sys/types.h>
10 10
11 #include <string> 11 #include <string>
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/command_line.h" 14 #include "base/command_line.h"
15 #include "base/file_util.h" 15 #include "base/file_util.h"
16 #include "base/logging.h" 16 #include "base/logging.h"
17 #include "base/threading/thread_restrictions.h" 17 #include "base/threading/thread_restrictions.h"
18 #include "chrome/browser/browser_process.h" 18 #include "chrome/browser/browser_process.h"
19 #include "chrome/browser/chromeos/cros_settings_names.h"
19 #include "chrome/browser/chromeos/cros/cros_library.h" 20 #include "chrome/browser/chromeos/cros/cros_library.h"
20 #include "chrome/browser/chromeos/cros/cryptohome_library.h" 21 #include "chrome/browser/chromeos/cros/cryptohome_library.h"
21 #include "chrome/browser/chromeos/customization_document.h" 22 #include "chrome/browser/chromeos/customization_document.h"
22 #include "chrome/browser/chromeos/language_preferences.h" 23 #include "chrome/browser/chromeos/language_preferences.h"
23 #include "chrome/browser/chromeos/login/enterprise_enrollment_screen.h" 24 #include "chrome/browser/chromeos/login/enterprise_enrollment_screen.h"
24 #include "chrome/browser/chromeos/login/eula_screen.h" 25 #include "chrome/browser/chromeos/login/eula_screen.h"
25 #include "chrome/browser/chromeos/login/existing_user_controller.h" 26 #include "chrome/browser/chromeos/login/existing_user_controller.h"
26 #include "chrome/browser/chromeos/login/helper.h" 27 #include "chrome/browser/chromeos/login/helper.h"
27 #include "chrome/browser/chromeos/login/html_page_screen.h" 28 #include "chrome/browser/chromeos/login/html_page_screen.h"
28 #include "chrome/browser/chromeos/login/login_display_host.h" 29 #include "chrome/browser/chromeos/login/login_display_host.h"
29 #include "chrome/browser/chromeos/login/login_utils.h" 30 #include "chrome/browser/chromeos/login/login_utils.h"
30 #include "chrome/browser/chromeos/login/network_screen.h" 31 #include "chrome/browser/chromeos/login/network_screen.h"
31 #include "chrome/browser/chromeos/login/oobe_display.h" 32 #include "chrome/browser/chromeos/login/oobe_display.h"
32 #include "chrome/browser/chromeos/login/registration_screen.h" 33 #include "chrome/browser/chromeos/login/registration_screen.h"
34 #include "chrome/browser/chromeos/login/signed_settings_temp_storage.h"
33 #include "chrome/browser/chromeos/login/update_screen.h" 35 #include "chrome/browser/chromeos/login/update_screen.h"
34 #include "chrome/browser/chromeos/login/user_image_screen.h" 36 #include "chrome/browser/chromeos/login/user_image_screen.h"
35 #include "chrome/browser/chromeos/login/user_manager.h" 37 #include "chrome/browser/chromeos/login/user_manager.h"
36 #include "chrome/browser/chromeos/login/wizard_accessibility_helper.h" 38 #include "chrome/browser/chromeos/login/wizard_accessibility_helper.h"
37 #include "chrome/browser/chromeos/metrics_cros_settings_provider.h"
38 #include "chrome/browser/prefs/pref_service.h" 39 #include "chrome/browser/prefs/pref_service.h"
39 #include "chrome/browser/profiles/profile_manager.h" 40 #include "chrome/browser/profiles/profile_manager.h"
41 #include "chrome/browser/ui/options/options_util.h"
40 #include "chrome/common/pref_names.h" 42 #include "chrome/common/pref_names.h"
41 #include "content/common/content_notification_types.h" 43 #include "content/common/content_notification_types.h"
42 #include "content/common/notification_service.h" 44 #include "content/common/notification_service.h"
43 #include "ui/base/l10n/l10n_util.h" 45 #include "ui/base/l10n/l10n_util.h"
44 #include "views/accelerator.h" 46 #include "views/accelerator.h"
45 47
48 #if defined(USE_LINUX_BREAKPAD)
49 #include "chrome/app/breakpad_linux.h"
50 #endif
51
46 namespace { 52 namespace {
47 53
48 // A boolean pref of the EULA accepted flag. 54 // A boolean pref of the EULA accepted flag.
49 const char kEulaAccepted[] = "EulaAccepted"; 55 const char kEulaAccepted[] = "EulaAccepted";
50 56
51 // A string pref with initial locale set in VPD or manifest. 57 // A string pref with initial locale set in VPD or manifest.
52 const char kInitialLocale[] = "intl.initial_locale"; 58 const char kInitialLocale[] = "intl.initial_locale";
53 59
54 // A boolean pref of the OOBE complete flag (first OOBE part before login). 60 // A boolean pref of the OOBE complete flag (first OOBE part before login).
55 const char kOobeComplete[] = "OobeComplete"; 61 const char kOobeComplete[] = "OobeComplete";
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 // TODO(dpolukhin): show error message after login screen is displayed. 377 // TODO(dpolukhin): show error message after login screen is displayed.
372 ShowLoginScreen(); 378 ShowLoginScreen();
373 } 379 }
374 380
375 void WizardController::OnUpdateCompleted() { 381 void WizardController::OnUpdateCompleted() {
376 OnOOBECompleted(); 382 OnOOBECompleted();
377 } 383 }
378 384
379 void WizardController::OnEulaAccepted() { 385 void WizardController::OnEulaAccepted() {
380 MarkEulaAccepted(); 386 MarkEulaAccepted();
381 chromeos::MetricsCrosSettingsProvider::SetMetricsStatus( 387 // TODO(pastarmovj): Make this code cache the value for the pref in a better
382 usage_statistics_reporting_); 388 // way until we can store it in the policy blob. See explanation below:
389 // At this point we can not write this in the signed settings pref blob.
390 // But we can at least create the consent file and Chrome would port that
391 // if the device is owned by a local user. In case of enterprise enrolled
392 // device the setting will be respected only until the policy is not set.
393 SignedSettingsTempStorage::Store(
394 kStatsReportingPref,
395 (usage_statistics_reporting_ ? "true" : "false"),
396 g_browser_process->local_state());
397 bool enabled =
398 OptionsUtil::ResolveMetricsReportingEnabled(usage_statistics_reporting_);
399 if (enabled) {
400 #if defined(USE_LINUX_BREAKPAD)
401 InitCrashReporter();
402 #endif
403 }
404
383 InitiateOOBEUpdate(); 405 InitiateOOBEUpdate();
384 } 406 }
385 407
386 void WizardController::OnUpdateErrorCheckingForUpdate() { 408 void WizardController::OnUpdateErrorCheckingForUpdate() {
387 // TODO(nkostylev): Update should be required during OOBE. 409 // TODO(nkostylev): Update should be required during OOBE.
388 // We do not want to block users from being able to proceed to the login 410 // We do not want to block users from being able to proceed to the login
389 // screen if there is any error checking for an update. 411 // screen if there is any error checking for an update.
390 // They could use "browse without sign-in" feature to set up the network to be 412 // They could use "browse without sign-in" feature to set up the network to be
391 // able to perform the update later. 413 // able to perform the update later.
392 OnOOBECompleted(); 414 OnOOBECompleted();
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 701
680 bool WizardController::usage_statistics_reporting() const { 702 bool WizardController::usage_statistics_reporting() const {
681 return usage_statistics_reporting_; 703 return usage_statistics_reporting_;
682 } 704 }
683 705
684 void WizardController::SetZeroDelays() { 706 void WizardController::SetZeroDelays() {
685 kShowDelayMs = 0; 707 kShowDelayMs = 0;
686 } 708 }
687 709
688 } // namespace chromeos 710 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/signed_settings.cc ('k') | chrome/browser/chromeos/metrics_cros_settings_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698