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

Unified Diff: chrome/browser/extensions/updater/extension_downloader_delegate.h

Issue 654363002: Move ExtensionDownloader to //extensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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: chrome/browser/extensions/updater/extension_downloader_delegate.h
diff --git a/chrome/browser/extensions/updater/extension_downloader_delegate.h b/chrome/browser/extensions/updater/extension_downloader_delegate.h
deleted file mode 100644
index f0b0a3c15fd4dd7abd82a1c19344bbc57d11bd81..0000000000000000000000000000000000000000
--- a/chrome/browser/extensions/updater/extension_downloader_delegate.h
+++ /dev/null
@@ -1,125 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_EXTENSIONS_UPDATER_EXTENSION_DOWNLOADER_DELEGATE_H_
-#define CHROME_BROWSER_EXTENSIONS_UPDATER_EXTENSION_DOWNLOADER_DELEGATE_H_
-
-#include <set>
-#include <string>
-
-#include "base/time/time.h"
-#include "extensions/browser/updater/manifest_fetch_data.h"
-
-class GURL;
-
-namespace base {
-class FilePath;
-}
-
-namespace extensions {
-
-class ExtensionDownloaderDelegate {
- public:
- virtual ~ExtensionDownloaderDelegate();
-
- // Passed as an argument to ExtensionDownloader::OnExtensionDownloadFailed()
- // to detail the reason for the failure.
- enum Error {
- // Background networking is disabled.
- DISABLED,
-
- // Failed to fetch the manifest for this extension.
- MANIFEST_FETCH_FAILED,
-
- // The manifest couldn't be parsed.
- MANIFEST_INVALID,
-
- // The manifest was fetched and parsed, and there are no updates for
- // this extension.
- NO_UPDATE_AVAILABLE,
-
- // There was an update for this extension but the download of the crx
- // failed.
- CRX_FETCH_FAILED,
- };
-
- // Passed as an argument to the completion callbacks to signal whether
- // the extension update sent a ping.
- struct PingResult {
- PingResult();
- ~PingResult();
-
- // Whether a ping was sent.
- bool did_ping;
-
- // The start of day, from the server's perspective. This is only valid
- // when |did_ping| is true.
- base::Time day_start;
- };
-
- // One of the following 3 methods is always invoked for a given extension
- // id, if AddExtension() or AddPendingExtension() returned true when that
- // extension was added to the ExtensionDownloader.
- // To avoid duplicate work, ExtensionDownloader might merge multiple identical
- // requests, so there is not necessarily a separate invocation of one of these
- // methods for each call to AddExtension/AddPendingExtension. If it is
- // important to be able to match up AddExtension calls with
- // OnExtensionDownload callbacks, you need to make sure that for every call to
- // AddExtension/AddPendingExtension the combination of extension id and
- // request id is unique. The OnExtensionDownload related callbacks will then
- // be called with all request ids that resulted in that extension being
- // checked.
-
- // Invoked if the extension couldn't be downloaded. |error| contains the
- // failure reason.
- virtual void OnExtensionDownloadFailed(const std::string& id,
- Error error,
- const PingResult& ping_result,
- const std::set<int>& request_ids);
-
- // Invoked if the extension had an update available and its crx was
- // successfully downloaded to |path|. |ownership_passed| is true if delegate
- // should get ownership of the file.
- virtual void OnExtensionDownloadFinished(
- const std::string& id,
- const base::FilePath& path,
- bool file_ownership_passed,
- const GURL& download_url,
- const std::string& version,
- const PingResult& ping_result,
- const std::set<int>& request_ids) = 0;
-
- // The remaining methods are used by the ExtensionDownloader to retrieve
- // information about extensions from the delegate.
-
- // Invoked to fill the PingData for the given extension id. Returns false
- // if PingData should not be included for this extension's update check
- // (this is the default).
- virtual bool GetPingDataForExtension(const std::string& id,
- ManifestFetchData::PingData* ping);
-
- // Invoked to get the update url data for this extension's update url, if
- // there is any. The default implementation returns an empty string.
- virtual std::string GetUpdateUrlData(const std::string& id);
-
- // Invoked to determine whether extension |id| is currently
- // pending installation.
- virtual bool IsExtensionPending(const std::string& id) = 0;
-
- // Invoked to get the current version of extension |id|. Returns false if
- // that extension is not installed.
- virtual bool GetExtensionExistingVersion(const std::string& id,
- std::string* version) = 0;
-
- // Determines if a given extension should be forced to update and (if so)
- // what the source of this forcing is (i.e. what string will be passed
- // in |installsource| as part of the update query parameters). The default
- // implementation always returns |false|.
- virtual bool ShouldForceUpdate(const std::string& id,
- std::string* source);
-};
-
-} // namespace extensions
-
-#endif // CHROME_BROWSER_EXTENSIONS_UPDATER_EXTENSION_DOWNLOADER_DELEGATE_H_

Powered by Google App Engine
This is Rietveld 408576698