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

Unified Diff: chrome/browser/extensions/crx_installer.h

Issue 2751013002: Simplify ExtensionInstallChecker into a single-use class (Closed)
Patch Set: todo Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/crx_installer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/crx_installer.h
diff --git a/chrome/browser/extensions/crx_installer.h b/chrome/browser/extensions/crx_installer.h
index 7d7168faefe45e2403f4c5cce3abac9cdadadd6f..e16d57cce649cf0ba724140a37bb07512d56e4e6 100644
--- a/chrome/browser/extensions/crx_installer.h
+++ b/chrome/browser/extensions/crx_installer.h
@@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_EXTENSIONS_CRX_INSTALLER_H_
#define CHROME_BROWSER_EXTENSIONS_CRX_INSTALLER_H_
+#include <memory>
#include <string>
#include <vector>
@@ -14,7 +15,6 @@
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/version.h"
-#include "chrome/browser/extensions/extension_install_checker.h"
#include "chrome/browser/extensions/extension_install_prompt.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/webstore_installer.h"
@@ -36,6 +36,7 @@ class SequencedTaskRunner;
namespace extensions {
class CrxInstallError;
+class ExtensionInstallChecker;
class ExtensionUpdaterTest;
// This class installs a crx file into a profile.
@@ -200,9 +201,9 @@ class CrxInstaller : public SandboxedUnpackerClient {
bool did_handle_successfully() const { return did_handle_successfully_; }
- Profile* profile() { return install_checker_.profile(); }
+ Profile* profile() { return profile_; }
- const Extension* extension() { return install_checker_.extension().get(); }
+ const Extension* extension() { return extension_.get(); }
// The currently installed version of the extension, for updates. Will be
// invalid if this isn't an update.
@@ -211,7 +212,6 @@ class CrxInstaller : public SandboxedUnpackerClient {
private:
friend class ::ExtensionServiceTest;
friend class ExtensionUpdaterTest;
- friend class ExtensionCrxInstallerTest;
CrxInstaller(base::WeakPtr<ExtensionService> service_weak,
std::unique_ptr<ExtensionInstallPrompt> client,
@@ -288,6 +288,12 @@ class CrxInstaller : public SandboxedUnpackerClient {
install_flags_ &= ~flag;
}
+ // The Profile the extension is being installed in.
+ Profile* profile_;
+
+ // The extension being installed.
+ scoped_refptr<const Extension> extension_;
+
// The file we're installing.
base::FilePath source_file_;
@@ -438,7 +444,7 @@ class CrxInstaller : public SandboxedUnpackerClient {
int install_flags_;
// Performs requirements, policy and blacklist checks on the extension.
- ExtensionInstallChecker install_checker_;
+ std::unique_ptr<ExtensionInstallChecker> install_checker_;
DISALLOW_COPY_AND_ASSIGN(CrxInstaller);
};
« no previous file with comments | « no previous file | chrome/browser/extensions/crx_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698