blob: b82cd96a29a311c9ea4c686fe9ccfaa12885b831 [file] [log] [blame]
ryanackley48bedbd2015-01-27 23:12:141// 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.
4
5#ifndef CHROME_BROWSER_EXTENSIONS_APP_DATA_MIGRATOR_H_
6#define CHROME_BROWSER_EXTENSIONS_APP_DATA_MIGRATOR_H_
7
8#include "base/callback_forward.h"
9#include "base/macros.h"
10#include "base/memory/weak_ptr.h"
11
12class Profile;
13
14namespace extensions {
15class Extension;
16class ExtensionRegistry;
17
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
21class AppDataMigrator {
22 public:
23 AppDataMigrator(Profile* profile, ExtensionRegistry* registry);
24 ~AppDataMigrator();
25
26 static bool NeedsMigration(const Extension* old, const Extension* extension);
27
28 void DoMigrationAndReply(const Extension* old,
29 const Extension* extension,
30 const base::Closure& reply);
31
32 private:
33 Profile* profile_;
34 ExtensionRegistry* registry_;
Jeremy Roman495db682019-07-12 16:03:2435 base::WeakPtrFactory<AppDataMigrator> weak_factory_{this};
ryanackley48bedbd2015-01-27 23:12:1436
37 DISALLOW_COPY_AND_ASSIGN(AppDataMigrator);
38};
39
40} // namespace extensions
41
42#endif // CHROME_BROWSER_EXTENSIONS_APP_DATA_MIGRATOR_H_