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

Unified Diff: components/component_updater/component_updater_service.h

Issue 2154773002: Implement Just-In-Time Flash updates. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Through #27 + lint/format + offline comments Created 4 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 side-by-side diff with in-line comments
Download patch
Index: components/component_updater/component_updater_service.h
diff --git a/components/component_updater/component_updater_service.h b/components/component_updater/component_updater_service.h
index 7abf4d6bc955908e802777df0a2874d5e9863a19..c257ae499a5981adf4f943102206572586ad3ab9 100644
--- a/components/component_updater/component_updater_service.h
+++ b/components/component_updater/component_updater_service.h
@@ -19,6 +19,7 @@
#include "url/gurl.h"
class ComponentsUI;
+class PluginObserver;
class SupervisedUserWhitelistService;
namespace base {
@@ -51,6 +52,14 @@ using Configurator = update_client::Configurator;
using CrxComponent = update_client::CrxComponent;
using CrxUpdateItem = update_client::CrxUpdateItem;
+struct ComponentInfo {
+ ComponentInfo();
+ ~ComponentInfo();
+
+ std::string id;
+ base::string16 name;
+};
+
// The component update service is in charge of installing or upgrading
// select parts of chrome. Each part is called a component and managed by
// instances of CrxComponent registered using RegisterComponent(). On the
@@ -96,6 +105,14 @@ class ComponentUpdateService {
// Returns a list of registered components.
virtual std::vector<std::string> GetComponentIDs() const = 0;
+ // Returns true and fills the members of |info| if there is a registered
+ // component that implements a handler for the specified |mime_type|; else
+ // returns false and does not mutate the members of |info|. If multiple
+ // such components exist, returns information for the one that was most
+ // recently registered.
+ virtual bool GetComponentForMimeType(const std::string& mime_type,
+ ComponentInfo* info) const = 0;
Sorin Jianu 2016/07/28 21:04:05 Another idea for this would be to return by value
waffles 2016/07/28 23:05:52 Done.
+
// Returns an interface for on-demand updates. On-demand updates are
// proactively triggered outside the normal component update service schedule.
virtual OnDemandUpdater& GetOnDemandUpdater() = 0;
@@ -140,6 +157,7 @@ class OnDemandUpdater {
friend class OnDemandTester;
friend class SupervisedUserWhitelistInstaller;
friend class ::ComponentsUI;
+ friend class ::PluginObserver;
// Triggers an update check for a component. |id| is a value
// returned by GetCrxComponentID(). If an update for this component is already

Powered by Google App Engine
This is Rietveld 408576698