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

Unified Diff: components/component_updater/default_component_installer.h

Issue 1937683002: Implement support in DefaultComponentInstaller for picking up bundled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments through #35 Created 4 years, 7 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
Index: components/component_updater/default_component_installer.h
diff --git a/components/component_updater/default_component_installer.h b/components/component_updater/default_component_installer.h
index ff337df976f59e3d8d6388caaa87c20bb01b0662..e8f8df29876c497696af9a0672f4ff07264dc834 100644
--- a/components/component_updater/default_component_installer.h
+++ b/components/component_updater/default_component_installer.h
@@ -12,6 +12,7 @@
#include <vector>
#include "base/callback_forward.h"
+#include "base/files/file_path.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/threading/thread_checker.h"
@@ -20,7 +21,6 @@
#include "components/update_client/update_client.h"
namespace base {
-class FilePath;
class SequencedTaskRunner;
class SingleThreadTaskRunner;
} // namespace base
@@ -76,9 +76,9 @@ class ComponentInstallerTraits {
const base::FilePath& install_dir,
std::unique_ptr<base::DictionaryValue> manifest) = 0;
- // Returns the directory that the installer will place versioned installs of
- // the component into.
- virtual base::FilePath GetBaseDirectory() const = 0;
+ // Returns a relative path that will be appended to the component updater
+ // root directories to find the data for this particular component.
+ virtual base::FilePath GetRelativeInstallDir() const = 0;
// Returns the component's SHA2 hash as raw bytes.
virtual void GetHash(std::vector<uint8_t>* hash) const = 0;
@@ -112,12 +112,17 @@ class DefaultComponentInstaller : public update_client::CrxInstaller {
const base::FilePath& unpack_path) override;
bool GetInstalledFile(const std::string& file,
base::FilePath* installed_file) override;
+ // Only user-level component installations can be uninstalled.
bool Uninstall() override;
private:
~DefaultComponentInstaller() override;
- base::FilePath GetInstallDirectory();
+ // If there is a installation of the component set up alongside Chrome's
+ // files (as opposed to in the user data directory), sets current_* to the
+ // values associated with that installation and returns true; otherwise,
+ // returns false.
+ bool FindPreinstallation();
bool InstallHelper(const base::DictionaryValue& manifest,
const base::FilePath& unpack_path,
const base::FilePath& install_path);
@@ -127,6 +132,7 @@ class DefaultComponentInstaller : public update_client::CrxInstaller {
void ComponentReady(std::unique_ptr<base::DictionaryValue> manifest);
void UninstallOnTaskRunner();
+ base::FilePath current_install_dir_;
base::Version current_version_;
std::string current_fingerprint_;
std::unique_ptr<base::DictionaryValue> current_manifest_;
« no previous file with comments | « components/component_updater/component_updater_paths.cc ('k') | components/component_updater/default_component_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698