| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/startup/startup_browser_creator_impl.h" | 5 #include "chrome/browser/ui/startup/startup_browser_creator_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| 11 #include <memory> |
| 11 #include <vector> | 12 #include <vector> |
| 12 | 13 |
| 13 #include "apps/app_restore_service.h" | 14 #include "apps/app_restore_service.h" |
| 14 #include "apps/app_restore_service_factory.h" | 15 #include "apps/app_restore_service_factory.h" |
| 15 #include "base/bind.h" | 16 #include "base/bind.h" |
| 16 #include "base/bind_helpers.h" | 17 #include "base/bind_helpers.h" |
| 17 #include "base/command_line.h" | 18 #include "base/command_line.h" |
| 18 #include "base/compiler_specific.h" | 19 #include "base/compiler_specific.h" |
| 19 #include "base/environment.h" | 20 #include "base/environment.h" |
| 20 #include "base/lazy_instance.h" | 21 #include "base/lazy_instance.h" |
| 21 #include "base/memory/scoped_ptr.h" | |
| 22 #include "base/metrics/histogram_macros.h" | 22 #include "base/metrics/histogram_macros.h" |
| 23 #include "base/metrics/statistics_recorder.h" | 23 #include "base/metrics/statistics_recorder.h" |
| 24 #include "base/strings/string_number_conversions.h" | 24 #include "base/strings/string_number_conversions.h" |
| 25 #include "base/strings/string_split.h" | 25 #include "base/strings/string_split.h" |
| 26 #include "base/strings/string_util.h" | 26 #include "base/strings/string_util.h" |
| 27 #include "base/strings/stringprintf.h" | 27 #include "base/strings/stringprintf.h" |
| 28 #include "base/strings/utf_string_conversions.h" | 28 #include "base/strings/utf_string_conversions.h" |
| 29 #include "base/threading/thread_restrictions.h" | 29 #include "base/threading/thread_restrictions.h" |
| 30 #include "build/build_config.h" | 30 #include "build/build_config.h" |
| 31 #include "chrome/browser/apps/install_chrome_app.h" | 31 #include "chrome/browser/apps/install_chrome_app.h" |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 if (!si.lpTitle) | 150 if (!si.lpTitle) |
| 151 return LM_SHORTCUT_NONAME; | 151 return LM_SHORTCUT_NONAME; |
| 152 base::string16 shortcut(si.lpTitle); | 152 base::string16 shortcut(si.lpTitle); |
| 153 // The windows quick launch path is not localized. | 153 // The windows quick launch path is not localized. |
| 154 if (shortcut.find(L"\\Quick Launch\\") != base::string16::npos) { | 154 if (shortcut.find(L"\\Quick Launch\\") != base::string16::npos) { |
| 155 if (base::win::GetVersion() >= base::win::VERSION_WIN7) | 155 if (base::win::GetVersion() >= base::win::VERSION_WIN7) |
| 156 return LM_SHORTCUT_TASKBAR; | 156 return LM_SHORTCUT_TASKBAR; |
| 157 else | 157 else |
| 158 return LM_SHORTCUT_QUICKLAUNCH; | 158 return LM_SHORTCUT_QUICKLAUNCH; |
| 159 } | 159 } |
| 160 scoped_ptr<base::Environment> env(base::Environment::Create()); | 160 std::unique_ptr<base::Environment> env(base::Environment::Create()); |
| 161 std::string appdata_path; | 161 std::string appdata_path; |
| 162 env->GetVar("USERPROFILE", &appdata_path); | 162 env->GetVar("USERPROFILE", &appdata_path); |
| 163 if (!appdata_path.empty() && | 163 if (!appdata_path.empty() && |
| 164 shortcut.find(base::ASCIIToUTF16(appdata_path)) != base::string16::npos) | 164 shortcut.find(base::ASCIIToUTF16(appdata_path)) != base::string16::npos) |
| 165 return LM_SHORTCUT_DESKTOP; | 165 return LM_SHORTCUT_DESKTOP; |
| 166 return LM_SHORTCUT_UNKNOWN; | 166 return LM_SHORTCUT_UNKNOWN; |
| 167 } | 167 } |
| 168 return LM_SHORTCUT_NONE; | 168 return LM_SHORTCUT_NONE; |
| 169 } | 169 } |
| 170 #else | 170 #else |
| (...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1004 #if defined(OS_WIN) | 1004 #if defined(OS_WIN) |
| 1005 TriggeredProfileResetter* triggered_profile_resetter = | 1005 TriggeredProfileResetter* triggered_profile_resetter = |
| 1006 TriggeredProfileResetterFactory::GetForBrowserContext(profile_); | 1006 TriggeredProfileResetterFactory::GetForBrowserContext(profile_); |
| 1007 // TriggeredProfileResetter instance will be nullptr for incognito profiles. | 1007 // TriggeredProfileResetter instance will be nullptr for incognito profiles. |
| 1008 if (triggered_profile_resetter) { | 1008 if (triggered_profile_resetter) { |
| 1009 has_reset_trigger = triggered_profile_resetter->HasResetTrigger(); | 1009 has_reset_trigger = triggered_profile_resetter->HasResetTrigger(); |
| 1010 } | 1010 } |
| 1011 #endif // defined(OS_WIN) | 1011 #endif // defined(OS_WIN) |
| 1012 return has_reset_trigger; | 1012 return has_reset_trigger; |
| 1013 } | 1013 } |
| OLD | NEW |