| 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/macros.h" | 6 #include "base/macros.h" |
| 7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.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 27 matching lines...) Expand all Loading... |
| 38 ExtensionService* service = | 38 ExtensionService* service = |
| 39 extensions::ExtensionSystem::Get(profile)->extension_service(); | 39 extensions::ExtensionSystem::Get(profile)->extension_service(); |
| 40 if (!service) | 40 if (!service) |
| 41 return; | 41 return; |
| 42 | 42 |
| 43 const extensions::Extension* extension = | 43 const extensions::Extension* extension = |
| 44 service->GetExtensionById(extension_misc::kFirstRunDialogId, false); | 44 service->GetExtensionById(extension_misc::kFirstRunDialogId, false); |
| 45 if (!extension) | 45 if (!extension) |
| 46 return; | 46 return; |
| 47 | 47 |
| 48 OpenApplication( | 48 OpenApplication(AppLaunchParams( |
| 49 AppLaunchParams(profile, extension, extensions::LAUNCH_CONTAINER_WINDOW, | 49 profile, extension, extensions::LAUNCH_CONTAINER_WINDOW, |
| 50 NEW_WINDOW, extensions::SOURCE_CHROME_INTERNAL)); | 50 WindowOpenDisposition::NEW_WINDOW, extensions::SOURCE_CHROME_INTERNAL)); |
| 51 profile->GetPrefs()->SetBoolean(prefs::kFirstRunTutorialShown, true); | 51 profile->GetPrefs()->SetBoolean(prefs::kFirstRunTutorialShown, true); |
| 52 } | 52 } |
| 53 | 53 |
| 54 // Object of this class waits for session start. Then it launches or not | 54 // Object of this class waits for session start. Then it launches or not |
| 55 // launches first-run dialog depending on user prefs and flags. Than object | 55 // launches first-run dialog depending on user prefs and flags. Than object |
| 56 // deletes itself. | 56 // deletes itself. |
| 57 class DialogLauncher : public content::NotificationObserver { | 57 class DialogLauncher : public content::NotificationObserver { |
| 58 public: | 58 public: |
| 59 explicit DialogLauncher(Profile* profile) | 59 explicit DialogLauncher(Profile* profile) |
| 60 : profile_(profile) { | 60 : profile_(profile) { |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 user_manager::UserManager::Get()->GetActiveUser())); | 114 user_manager::UserManager::Get()->GetActiveUser())); |
| 115 } | 115 } |
| 116 | 116 |
| 117 void LaunchTutorial() { | 117 void LaunchTutorial() { |
| 118 UMA_HISTOGRAM_BOOLEAN("CrosFirstRun.TutorialLaunched", true); | 118 UMA_HISTOGRAM_BOOLEAN("CrosFirstRun.TutorialLaunched", true); |
| 119 FirstRunController::Start(); | 119 FirstRunController::Start(); |
| 120 } | 120 } |
| 121 | 121 |
| 122 } // namespace first_run | 122 } // namespace first_run |
| 123 } // namespace chromeos | 123 } // namespace chromeos |
| OLD | NEW |