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

Side by Side Diff: chrome/browser/component_updater/subresource_filter_component_installer.h

Issue 2844063002: Add support for multiple simultaneous subresource_filter::Configurations. (Closed)
Patch Set: Rebase. Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_COMPONENT_UPDATER_SUBRESOURCE_FILTER_COMPONENT_INSTALLER_ H_ 5 #ifndef CHROME_BROWSER_COMPONENT_UPDATER_SUBRESOURCE_FILTER_COMPONENT_INSTALLER_ H_
6 #define CHROME_BROWSER_COMPONENT_UPDATER_SUBRESOURCE_FILTER_COMPONENT_INSTALLER_ H_ 6 #define CHROME_BROWSER_COMPONENT_UPDATER_SUBRESOURCE_FILTER_COMPONENT_INSTALLER_ H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/gtest_prod_util.h"
12 #include "components/component_updater/default_component_installer.h" 13 #include "components/component_updater/default_component_installer.h"
13 14
14 namespace base { 15 namespace base {
15 class FilePath; 16 class FilePath;
16 } // namespace base 17 } // namespace base
17 18
18 namespace component_updater { 19 namespace component_updater {
19 20
20 class ComponentUpdateService; 21 class ComponentUpdateService;
21 22
22 // Component for receiving Safe Browsing Subresource filtering rules. 23 // Component for receiving Safe Browsing Subresource filtering rules.
23 class SubresourceFilterComponentInstallerTraits 24 class SubresourceFilterComponentInstallerTraits
24 : public ComponentInstallerTraits { 25 : public ComponentInstallerTraits {
25 public: 26 public:
26 static const char kManifestRulesetFormatKey[]; 27 static const char kManifestRulesetFormatKey[];
27 static const int kCurrentRulesetFormat; 28 static const int kCurrentRulesetFormat;
28 29
29 SubresourceFilterComponentInstallerTraits(); 30 SubresourceFilterComponentInstallerTraits();
30 ~SubresourceFilterComponentInstallerTraits() override; 31 ~SubresourceFilterComponentInstallerTraits() override;
31 32
32 private: 33 private:
33 friend class SubresourceFilterComponentInstallerTest; 34 friend class SubresourceFilterComponentInstallerTest;
35 FRIEND_TEST_ALL_PREFIXES(SubresourceFilterComponentInstallerTest,
36 InstallerTag);
34 37
35 static std::string GetInstallerTag(); 38 static std::string GetInstallerTag();
36 39
37 // ComponentInstallerTraits implementation. 40 // ComponentInstallerTraits implementation.
38 bool SupportsGroupPolicyEnabledComponentUpdates() const override; 41 bool SupportsGroupPolicyEnabledComponentUpdates() const override;
39 bool RequiresNetworkEncryption() const override; 42 bool RequiresNetworkEncryption() const override;
40 update_client::CrxInstaller::Result OnCustomInstall( 43 update_client::CrxInstaller::Result OnCustomInstall(
41 const base::DictionaryValue& manifest, 44 const base::DictionaryValue& manifest,
42 const base::FilePath& install_dir) override; 45 const base::FilePath& install_dir) override;
43 bool VerifyInstallation(const base::DictionaryValue& manifest, 46 bool VerifyInstallation(const base::DictionaryValue& manifest,
44 const base::FilePath& install_dir) const override; 47 const base::FilePath& install_dir) const override;
45 void ComponentReady(const base::Version& version, 48 void ComponentReady(const base::Version& version,
46 const base::FilePath& install_dir, 49 const base::FilePath& install_dir,
47 std::unique_ptr<base::DictionaryValue> manifest) override; 50 std::unique_ptr<base::DictionaryValue> manifest) override;
48 base::FilePath GetRelativeInstallDir() const override; 51 base::FilePath GetRelativeInstallDir() const override;
49 void GetHash(std::vector<uint8_t>* hash) const override; 52 void GetHash(std::vector<uint8_t>* hash) const override;
50 std::string GetName() const override; 53 std::string GetName() const override;
51 update_client::InstallerAttributes GetInstallerAttributes() const override; 54 update_client::InstallerAttributes GetInstallerAttributes() const override;
52 std::vector<std::string> GetMimeTypes() const override; 55 std::vector<std::string> GetMimeTypes() const override;
53 56
54 DISALLOW_COPY_AND_ASSIGN(SubresourceFilterComponentInstallerTraits); 57 DISALLOW_COPY_AND_ASSIGN(SubresourceFilterComponentInstallerTraits);
55 }; 58 };
56 59
57 void RegisterSubresourceFilterComponent(ComponentUpdateService* cus); 60 void RegisterSubresourceFilterComponent(ComponentUpdateService* cus);
58 61
59 } // namespace component_updater 62 } // namespace component_updater
60 63
61 #endif // CHROME_BROWSER_COMPONENT_UPDATER_SUBRESOURCE_FILTER_COMPONENT_INSTALL ER_H_ 64 #endif // CHROME_BROWSER_COMPONENT_UPDATER_SUBRESOURCE_FILTER_COMPONENT_INSTALL ER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698