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

Side by Side Diff: extensions/browser/updater/update_data_provider.h

Issue 1362043005: Add extensions code to use common updater in components/update_client/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merged latest origin/master Created 5 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef EXTENSIONS_BROWSER_UPDATER_UPDATE_DATA_PROVIDER_H_
6 #define EXTENSIONS_BROWSER_UPDATER_UPDATE_DATA_PROVIDER_H_
7
8 #include <string>
9 #include <vector>
10
11 #include "base/callback.h"
12 #include "base/macros.h"
13 #include "base/memory/ref_counted.h"
14
15 namespace base {
16 class FilePath;
17 }
18
19 namespace content {
20 class BrowserContext;
21 }
22
23 namespace update_client {
24 struct CrxComponent;
25 }
26
27 namespace extensions {
28
29 // This class exists to let an UpdateClient retrieve information about a set of
30 // extensions it is doing an update check for.
31 class UpdateDataProvider : public base::RefCounted<UpdateDataProvider> {
32 public:
33 typedef base::Callback<void(content::BrowserContext* context,
34 const std::string& /* extension_id */,
35 const base::FilePath& /* temp_dir */)>
36 InstallCallback;
37
38 // We need a browser context to use when retrieving data for a set of
39 // extension ids, as well as a callback for proceeding with installation
40 // steps once the UpdateClient has downloaded and unpacked an update for an
41 // extension.
42 UpdateDataProvider(content::BrowserContext* context,
43 const InstallCallback& callback);
44
45 // Notify this object that the associated browser context is being shut down
46 // the pointer to the context should be dropped and no more work should be
47 // done.
48 void Shutdown();
49
50 // Matches update_client::UpdateClient::CrxDataCallback
51 void GetData(const std::vector<std::string>& ids,
52 std::vector<update_client::CrxComponent>* data);
53
54 private:
55 friend class base::RefCounted<UpdateDataProvider>;
56 ~UpdateDataProvider();
57
58 void RunInstallCallback(const std::string& extension_id,
59 const base::FilePath& temp_dir);
60
61 content::BrowserContext* context_;
62 InstallCallback callback_;
63
64 DISALLOW_COPY_AND_ASSIGN(UpdateDataProvider);
65 };
66
67 } // namespace extensions
68
69 #endif // EXTENSIONS_BROWSER_UPDATER_UPDATE_DATA_PROVIDER_H_
OLDNEW
« no previous file with comments | « extensions/browser/updater/update_client_config.cc ('k') | extensions/browser/updater/update_data_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698