Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(276)

Side by Side Diff: chrome/browser/extensions/extension_installer.h

Issue 381553002: Update the CrxInstaller and UnpackedInstaller to use the ExtensionInstallChecker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved include to correct file Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2013 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_EXTENSION_INSTALLER_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALLER_H_
7
8 #include <string>
9 #include <vector>
10
11 #include "base/memory/weak_ptr.h"
12 #include "base/strings/string16.h"
13 #include "chrome/browser/extensions/extension_service.h"
14 #include "chrome/browser/extensions/requirements_checker.h"
15 #include "extensions/common/extension.h"
16
17 class Profile;
18
19 namespace content {
20 class WebContents;
21 }
22
23 namespace extensions {
24
25
26 // Holds common methods and data of extension installers.
27 //
28 // NOTE: This class is deprecated and has been replaced by
29 // ExtensionInstallChecker.
30 // TODO(tmdiep): CrxInstaller and UnpackedInstaller should be refactored to use
31 // this class (crbug.com/386404).
32 class ExtensionInstaller {
33 public:
34 typedef base::Callback<void(std::vector<std::string>)> RequirementsCallback;
35
36 explicit ExtensionInstaller(Profile* profile);
37 ~ExtensionInstaller();
38
39 // Called on the UI thread to start the requirements check on the extension
40 void CheckRequirements(const RequirementsCallback& callback);
41
42 // Checks the management policy if the extension can be installed.
43 base::string16 CheckManagementPolicy();
44
45 Profile* profile() const {
46 return profile_;
47 }
48
49 void set_extension(const Extension* extension) {
50 extension_ = extension;
51 }
52
53 scoped_refptr<const Extension> extension() {
54 return extension_;
55 }
56
57 private:
58 scoped_ptr<RequirementsChecker> requirements_checker_;
59
60 // The Profile where the extension is being installed in.
61 Profile* profile_;
62
63 // The extension we're installing. We either pass it off to ExtensionService
64 // on success, or drop the reference on failure.
65 scoped_refptr<const Extension> extension_;
66
67 base::WeakPtrFactory<ExtensionInstaller> weak_ptr_factory_;
68
69 DISALLOW_COPY_AND_ASSIGN(ExtensionInstaller);
70 };
71
72 } // namespace extensions
73
74 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_install_checker.cc ('k') | chrome/browser/extensions/extension_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698