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_EXTENSION_MIGRATOR_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_MIGRATOR_H_
10 #include "base/macros.h"
11 #include "chrome/browser/extensions/external_loader.h"
15 namespace extensions
{
17 // An ExternalLoader that provides the new extension for the following
19 // - Existing profile that has the old.
20 // - Existing profile that already has the new.
21 // Note that the old extension is not removed.
22 class ExtensionMigrator
: public ExternalLoader
{
24 ExtensionMigrator(Profile
* profile
,
25 const std::string
& old_id
,
26 const std::string
& new_id
);
29 ~ExtensionMigrator() override
;
32 void StartLoading() override
;
35 bool IsAppPresent(const std::string
& app_id
);
38 const std::string old_id_
;
39 const std::string new_id_
;
41 DISALLOW_COPY_AND_ASSIGN(ExtensionMigrator
);
44 } // namespace extensions
46 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MIGRATOR_H_