| 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 18 matching lines...) Expand all Loading... |
| 29 #include "extensions/common/one_shot_event.h" | 29 #include "extensions/common/one_shot_event.h" |
| 30 | 30 |
| 31 using extensions::Extension; | 31 using extensions::Extension; |
| 32 | 32 |
| 33 namespace { | 33 namespace { |
| 34 | 34 |
| 35 // This version number is stored in local prefs to check whether app shortcuts | 35 // This version number is stored in local prefs to check whether app shortcuts |
| 36 // need to be recreated. This might happen when we change various aspects of app | 36 // need to be recreated. This might happen when we change various aspects of app |
| 37 // shortcuts like command-line flags or associated icons, binaries, etc. | 37 // shortcuts like command-line flags or associated icons, binaries, etc. |
| 38 #if defined(OS_MACOSX) | 38 #if defined(OS_MACOSX) |
| 39 const int kCurrentAppShortcutsVersion = 1; | 39 const int kCurrentAppShortcutsVersion = 2; |
| 40 #else | 40 #else |
| 41 const int kCurrentAppShortcutsVersion = 0; | 41 const int kCurrentAppShortcutsVersion = 0; |
| 42 #endif | 42 #endif |
| 43 | 43 |
| 44 // Delay in seconds before running UpdateShortcutsForAllApps. | 44 // Delay in seconds before running UpdateShortcutsForAllApps. |
| 45 const int kUpdateShortcutsForAllAppsDelay = 10; | 45 const int kUpdateShortcutsForAllAppsDelay = 10; |
| 46 | 46 |
| 47 void CreateShortcutsForApp(Profile* profile, const Extension* app) { | 47 void CreateShortcutsForApp(Profile* profile, const Extension* app) { |
| 48 web_app::ShortcutLocations creation_locations; | 48 web_app::ShortcutLocations creation_locations; |
| 49 | 49 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 return; | 161 return; |
| 162 | 162 |
| 163 content::BrowserThread::PostDelayedTask( | 163 content::BrowserThread::PostDelayedTask( |
| 164 content::BrowserThread::UI, | 164 content::BrowserThread::UI, |
| 165 FROM_HERE, | 165 FROM_HERE, |
| 166 base::Bind(&web_app::UpdateShortcutsForAllApps, | 166 base::Bind(&web_app::UpdateShortcutsForAllApps, |
| 167 profile_, | 167 profile_, |
| 168 base::Bind(&SetCurrentAppShortcutsVersion, prefs_)), | 168 base::Bind(&SetCurrentAppShortcutsVersion, prefs_)), |
| 169 base::TimeDelta::FromSeconds(kUpdateShortcutsForAllAppsDelay)); | 169 base::TimeDelta::FromSeconds(kUpdateShortcutsForAllAppsDelay)); |
| 170 } | 170 } |
| OLD | NEW |