| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/metrics/histogram.h" | 6 #include "base/metrics/histogram.h" |
| 7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
| 10 #include "chrome/browser/chromeos/first_run/first_run_controller.h" | 10 #include "chrome/browser/chromeos/first_run/first_run_controller.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 } | 61 } |
| 62 | 62 |
| 63 virtual ~DialogLauncher() {} | 63 virtual ~DialogLauncher() {} |
| 64 | 64 |
| 65 virtual void Observe(int type, | 65 virtual void Observe(int type, |
| 66 const content::NotificationSource& source, | 66 const content::NotificationSource& source, |
| 67 const content::NotificationDetails& details) override { | 67 const content::NotificationDetails& details) override { |
| 68 DCHECK(type == chrome::NOTIFICATION_SESSION_STARTED); | 68 DCHECK(type == chrome::NOTIFICATION_SESSION_STARTED); |
| 69 DCHECK(content::Details<const user_manager::User>(details).ptr() == | 69 DCHECK(content::Details<const user_manager::User>(details).ptr() == |
| 70 ProfileHelper::Get()->GetUserByProfile(profile_)); | 70 ProfileHelper::Get()->GetUserByProfile(profile_)); |
| 71 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 71 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 72 bool launched_in_test = command_line->HasSwitch(::switches::kTestType); | 72 bool launched_in_test = command_line->HasSwitch(::switches::kTestType); |
| 73 bool launched_in_telemetry = | 73 bool launched_in_telemetry = |
| 74 command_line->HasSwitch(switches::kOobeSkipPostLogin); | 74 command_line->HasSwitch(switches::kOobeSkipPostLogin); |
| 75 bool is_user_new = user_manager::UserManager::Get()->IsCurrentUserNew(); | 75 bool is_user_new = user_manager::UserManager::Get()->IsCurrentUserNew(); |
| 76 bool first_run_forced = command_line->HasSwitch(switches::kForceFirstRunUI); | 76 bool first_run_forced = command_line->HasSwitch(switches::kForceFirstRunUI); |
| 77 bool first_run_seen = | 77 bool first_run_seen = |
| 78 profile_->GetPrefs()->GetBoolean(prefs::kFirstRunTutorialShown); | 78 profile_->GetPrefs()->GetBoolean(prefs::kFirstRunTutorialShown); |
| 79 if (!launched_in_telemetry && | 79 if (!launched_in_telemetry && |
| 80 ((is_user_new && !first_run_seen && !launched_in_test) || | 80 ((is_user_new && !first_run_seen && !launched_in_test) || |
| 81 first_run_forced)) { | 81 first_run_forced)) { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 105 user_manager::UserManager::Get()->GetActiveUser())); | 105 user_manager::UserManager::Get()->GetActiveUser())); |
| 106 } | 106 } |
| 107 | 107 |
| 108 void LaunchTutorial() { | 108 void LaunchTutorial() { |
| 109 UMA_HISTOGRAM_BOOLEAN("CrosFirstRun.TutorialLaunched", true); | 109 UMA_HISTOGRAM_BOOLEAN("CrosFirstRun.TutorialLaunched", true); |
| 110 FirstRunController::Start(); | 110 FirstRunController::Start(); |
| 111 } | 111 } |
| 112 | 112 |
| 113 } // namespace first_run | 113 } // namespace first_run |
| 114 } // namespace chromeos | 114 } // namespace chromeos |
| OLD | NEW |