Commit 86c356ec authored by jackhou@chromium.org's avatar jackhou@chromium.org

[Mac]. Increment app shortcut version.

This also increments the app list shortcut version.

This will trigger a rebuild of all app shims.

This also disables updating all shortcuts in tests.

BUG=353047

Review URL: https://codereview.chromium.org/346753002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278397 0039d316-1c4b-4281-b951-d872f2087c98
parent 4ef0e94e
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "chrome/browser/apps/shortcut_manager.h" #include "chrome/browser/apps/shortcut_manager.h"
#include "base/bind.h" #include "base/bind.h"
#include "base/command_line.h"
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/prefs/pref_service.h" #include "base/prefs/pref_service.h"
#include "base/strings/string16.h" #include "base/strings/string16.h"
...@@ -17,6 +18,7 @@ ...@@ -17,6 +18,7 @@
#include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/shell_integration.h" #include "chrome/browser/shell_integration.h"
#include "chrome/browser/web_applications/web_app.h" #include "chrome/browser/web_applications/web_app.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h" #include "chrome/common/pref_names.h"
#include "components/pref_registry/pref_registry_syncable.h" #include "components/pref_registry/pref_registry_syncable.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
...@@ -33,7 +35,11 @@ namespace { ...@@ -33,7 +35,11 @@ namespace {
// This version number is stored in local prefs to check whether app shortcuts // 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 // need to be recreated. This might happen when we change various aspects of app
// shortcuts like command-line flags or associated icons, binaries, etc. // shortcuts like command-line flags or associated icons, binaries, etc.
#if defined(OS_MACOSX)
const int kCurrentAppShortcutsVersion = 1;
#else
const int kCurrentAppShortcutsVersion = 0; const int kCurrentAppShortcutsVersion = 0;
#endif
// Delay in seconds before running UpdateShortcutsForAllApps. // Delay in seconds before running UpdateShortcutsForAllApps.
const int kUpdateShortcutsForAllAppsDelay = 10; const int kUpdateShortcutsForAllAppsDelay = 10;
...@@ -147,6 +153,9 @@ void AppShortcutManager::OnProfileWillBeRemoved( ...@@ -147,6 +153,9 @@ void AppShortcutManager::OnProfileWillBeRemoved(
} }
void AppShortcutManager::UpdateShortcutsForAllAppsIfNeeded() { void AppShortcutManager::UpdateShortcutsForAllAppsIfNeeded() {
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType))
return;
int last_version = prefs_->GetInteger(prefs::kAppShortcutsVersion); int last_version = prefs_->GetInteger(prefs::kAppShortcutsVersion);
if (last_version >= kCurrentAppShortcutsVersion) if (last_version >= kCurrentAppShortcutsVersion)
return; return;
......
...@@ -79,7 +79,7 @@ class ImageSkia; ...@@ -79,7 +79,7 @@ class ImageSkia;
namespace { namespace {
// Version of the app list shortcut version installed. // Version of the app list shortcut version installed.
const int kShortcutVersion = 1; const int kShortcutVersion = 2;
// Duration of show and hide animations. // Duration of show and hide animations.
const NSTimeInterval kAnimationDuration = 0.2; const NSTimeInterval kAnimationDuration = 0.2;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment