| 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 "chrome/browser/apps/shortcut_manager.h" | 5 #include "chrome/browser/apps/shortcut_manager.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 const base::FilePath& profile_path) { | 147 const base::FilePath& profile_path) { |
| 148 if (profile_path != profile_->GetPath()) | 148 if (profile_path != profile_->GetPath()) |
| 149 return; | 149 return; |
| 150 content::BrowserThread::PostTask( | 150 content::BrowserThread::PostTask( |
| 151 content::BrowserThread::FILE, FROM_HERE, | 151 content::BrowserThread::FILE, FROM_HERE, |
| 152 base::Bind(&web_app::internals::DeleteAllShortcutsForProfile, | 152 base::Bind(&web_app::internals::DeleteAllShortcutsForProfile, |
| 153 profile_path)); | 153 profile_path)); |
| 154 } | 154 } |
| 155 | 155 |
| 156 void AppShortcutManager::UpdateShortcutsForAllAppsIfNeeded() { | 156 void AppShortcutManager::UpdateShortcutsForAllAppsIfNeeded() { |
| 157 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)) | 157 if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)) |
| 158 return; | 158 return; |
| 159 | 159 |
| 160 int last_version = prefs_->GetInteger(prefs::kAppShortcutsVersion); | 160 int last_version = prefs_->GetInteger(prefs::kAppShortcutsVersion); |
| 161 if (last_version >= kCurrentAppShortcutsVersion) | 161 if (last_version >= kCurrentAppShortcutsVersion) |
| 162 return; | 162 return; |
| 163 | 163 |
| 164 content::BrowserThread::PostDelayedTask( | 164 content::BrowserThread::PostDelayedTask( |
| 165 content::BrowserThread::UI, | 165 content::BrowserThread::UI, |
| 166 FROM_HERE, | 166 FROM_HERE, |
| 167 base::Bind(&web_app::UpdateShortcutsForAllApps, | 167 base::Bind(&web_app::UpdateShortcutsForAllApps, |
| 168 profile_, | 168 profile_, |
| 169 base::Bind(&SetCurrentAppShortcutsVersion, prefs_)), | 169 base::Bind(&SetCurrentAppShortcutsVersion, prefs_)), |
| 170 base::TimeDelta::FromSeconds(kUpdateShortcutsForAllAppsDelay)); | 170 base::TimeDelta::FromSeconds(kUpdateShortcutsForAllAppsDelay)); |
| 171 } | 171 } |
| OLD | NEW |