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"
14 namespace extensions
{
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
{
23 AppDataMigrator(Profile
* profile
, ExtensionRegistry
* registry
);
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
);
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_