#include <string>
#include <vector>
+#include "base/bind.h"
#include "base/files/file_path.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
class UnpackedInstaller
: public base::RefCountedThreadSafe<UnpackedInstaller> {
public:
+ typedef base::Callback<void(const base::FilePath&, const std::string&)>
+ OnFailureCallback;
+
static scoped_refptr<UnpackedInstaller> Create(
ExtensionService* extension_service);
require_modern_manifest_version_ = val;
}
+ void set_on_failure_callback(const OnFailureCallback& callback) {
+ on_failure_callback_ = callback;
+ }
+
+ void set_be_noisy_on_failure(bool be_noisy_on_failure) {
+ be_noisy_on_failure_ = be_noisy_on_failure;
+ }
+
private:
friend class base::RefCountedThreadSafe<UnpackedInstaller>;
// the UI thread. In turn, once that gets the pref, it goes back to the
// file thread with LoadWithFileAccess.
// TODO(yoz): It would be nice to remove this ping-pong, but we need to know
- // what file access flags to pass to extension_file_util::LoadExtension.
+ // what file access flags to pass to file_util::LoadExtension.
void GetAbsolutePath();
void CheckExtensionFileAccess();
void LoadWithFileAccess(int flags);
+ // Notify the frontend that an attempt to retry will not be necessary.
+ void UnregisterLoadRetryListener();
+
// Notify the frontend that there was an error loading an extension.
void ReportExtensionLoadError(const std::string& error);
// version.
bool require_modern_manifest_version_;
+ // An optional callback to set in order to be notified of failure.
+ OnFailureCallback on_failure_callback_;
+
+ // Whether or not to be noisy (show a dialog) on failure. Defaults to true.
+ bool be_noisy_on_failure_;
+
// Gives access to common methods and data of an extension installer.
ExtensionInstaller installer_;