Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1883)

Unified Diff: chrome/browser/apps/shortcut_manager.cc

Issue 346753002: [Mac]. Increment app shortcut version. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comment Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/app_list/app_list_service_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/apps/shortcut_manager.cc
diff --git a/chrome/browser/apps/shortcut_manager.cc b/chrome/browser/apps/shortcut_manager.cc
index 7ec3d42262a863ffb2f3c28d6f706d3f0224a7a6..552fb348cadd0987f0d07f09fb6da6aa9132308b 100644
--- a/chrome/browser/apps/shortcut_manager.cc
+++ b/chrome/browser/apps/shortcut_manager.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/apps/shortcut_manager.h"
#include "base/bind.h"
+#include "base/command_line.h"
#include "base/compiler_specific.h"
#include "base/prefs/pref_service.h"
#include "base/strings/string16.h"
@@ -17,6 +18,7 @@
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/shell_integration.h"
#include "chrome/browser/web_applications/web_app.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "components/pref_registry/pref_registry_syncable.h"
#include "content/public/browser/browser_thread.h"
@@ -33,7 +35,11 @@ namespace {
// This version number is stored in local prefs to check whether app shortcuts
// need to be recreated. This might happen when we change various aspects of app
// shortcuts like command-line flags or associated icons, binaries, etc.
+#if defined(OS_MACOSX)
+const int kCurrentAppShortcutsVersion = 1;
+#else
const int kCurrentAppShortcutsVersion = 0;
+#endif
// Delay in seconds before running UpdateShortcutsForAllApps.
const int kUpdateShortcutsForAllAppsDelay = 10;
@@ -147,6 +153,9 @@ void AppShortcutManager::OnProfileWillBeRemoved(
}
void AppShortcutManager::UpdateShortcutsForAllAppsIfNeeded() {
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType))
+ return;
+
int last_version = prefs_->GetInteger(prefs::kAppShortcutsVersion);
if (last_version >= kCurrentAppShortcutsVersion)
return;
« no previous file with comments | « no previous file | chrome/browser/ui/app_list/app_list_service_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698