Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / browser / extensions / app_data_migrator.h
blob55d2989350a8ace4cbe47c3f324eaee3458a6284
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_EXTENSIONS_APP_DATA_MIGRATOR_H_
6 #define CHROME_BROWSER_EXTENSIONS_APP_DATA_MIGRATOR_H_
8 #include "base/callback_forward.h"
9 #include "base/macros.h"
10 #include "base/memory/weak_ptr.h"
12 class Profile;
14 namespace extensions {
15 class Extension;
16 class ExtensionRegistry;
18 // This class migrates legacy packaged app data in the general storage
19 // partition to an isolated storage partition. This happens when a legacy
20 // packaged app is upgraded to a platform app. See http://crbug.com/302577
21 class AppDataMigrator {
22 public:
23 AppDataMigrator(Profile* profile, ExtensionRegistry* registry);
24 ~AppDataMigrator();
26 static bool NeedsMigration(const Extension* old, const Extension* extension);
28 void DoMigrationAndReply(const Extension* old,
29 const Extension* extension,
30 const base::Closure& reply);
32 private:
33 Profile* profile_;
34 ExtensionRegistry* registry_;
35 base::WeakPtrFactory<AppDataMigrator> weak_factory_;
37 DISALLOW_COPY_AND_ASSIGN(AppDataMigrator);
40 } // namespace extensions
42 #endif // CHROME_BROWSER_EXTENSIONS_APP_DATA_MIGRATOR_H_