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

Side by Side Diff: chrome/browser/extensions/api/content_settings/content_settings_api.h

Issue 2328643003: [Extensions] Convert some ChromeSyncExtensionFunctions (Closed)
Patch Set: Remove GetProfile() usage Created 4 years, 3 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_EXTENSIONS_API_CONTENT_SETTINGS_CONTENT_SETTINGS_API_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_CONTENT_SETTINGS_CONTENT_SETTINGS_API_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_CONTENT_SETTINGS_CONTENT_SETTINGS_API_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_CONTENT_SETTINGS_CONTENT_SETTINGS_API_H_
7 7
8 #include "base/gtest_prod_util.h" 8 #include "base/gtest_prod_util.h"
9 #include "chrome/browser/extensions/chrome_extension_function.h" 9 #include "chrome/browser/extensions/chrome_extension_function.h"
10 10
11 class PluginFinder; 11 class PluginFinder;
12 12
13 namespace content { 13 namespace content {
14 struct WebPluginInfo; 14 struct WebPluginInfo;
15 } 15 }
16 16
17 namespace extensions { 17 namespace extensions {
18 18
19 class ContentSettingsContentSettingClearFunction 19 class ContentSettingsContentSettingClearFunction
20 : public ChromeSyncExtensionFunction { 20 : public UIThreadExtensionFunction {
21 public: 21 public:
22 DECLARE_EXTENSION_FUNCTION("contentSettings.clear", CONTENTSETTINGS_CLEAR) 22 DECLARE_EXTENSION_FUNCTION("contentSettings.clear", CONTENTSETTINGS_CLEAR)
23 23
24 protected: 24 protected:
25 ~ContentSettingsContentSettingClearFunction() override {} 25 ~ContentSettingsContentSettingClearFunction() override {}
26 26
27 // ExtensionFunction: 27 // ExtensionFunction:
28 bool RunSync() override; 28 ResponseAction Run() override;
29 }; 29 };
30 30
31 class ContentSettingsContentSettingGetFunction 31 class ContentSettingsContentSettingGetFunction
32 : public ChromeSyncExtensionFunction { 32 : public UIThreadExtensionFunction {
33 public: 33 public:
34 DECLARE_EXTENSION_FUNCTION("contentSettings.get", CONTENTSETTINGS_GET) 34 DECLARE_EXTENSION_FUNCTION("contentSettings.get", CONTENTSETTINGS_GET)
35 35
36 protected: 36 protected:
37 ~ContentSettingsContentSettingGetFunction() override {} 37 ~ContentSettingsContentSettingGetFunction() override {}
38 38
39 // ExtensionFunction: 39 // ExtensionFunction:
40 bool RunSync() override; 40 ResponseAction Run() override;
41 }; 41 };
42 42
43 class ContentSettingsContentSettingSetFunction 43 class ContentSettingsContentSettingSetFunction
44 : public ChromeSyncExtensionFunction { 44 : public UIThreadExtensionFunction {
45 public: 45 public:
46 DECLARE_EXTENSION_FUNCTION("contentSettings.set", CONTENTSETTINGS_SET) 46 DECLARE_EXTENSION_FUNCTION("contentSettings.set", CONTENTSETTINGS_SET)
47 47
48 protected: 48 protected:
49 ~ContentSettingsContentSettingSetFunction() override {} 49 ~ContentSettingsContentSettingSetFunction() override {}
50 50
51 // ExtensionFunction: 51 // ExtensionFunction:
52 bool RunSync() override; 52 ResponseAction Run() override;
53 }; 53 };
54 54
55 class ContentSettingsContentSettingGetResourceIdentifiersFunction 55 class ContentSettingsContentSettingGetResourceIdentifiersFunction
56 : public ChromeAsyncExtensionFunction { 56 : public ChromeAsyncExtensionFunction {
57 public: 57 public:
58 DECLARE_EXTENSION_FUNCTION("contentSettings.getResourceIdentifiers", 58 DECLARE_EXTENSION_FUNCTION("contentSettings.getResourceIdentifiers",
59 CONTENTSETTINGS_GETRESOURCEIDENTIFIERS) 59 CONTENTSETTINGS_GETRESOURCEIDENTIFIERS)
60 60
61 protected: 61 protected:
62 ~ContentSettingsContentSettingGetResourceIdentifiersFunction() override {} 62 ~ContentSettingsContentSettingGetResourceIdentifiersFunction() override {}
63 63
64 // ExtensionFunction: 64 // ExtensionFunction:
65 bool RunAsync() override; 65 bool RunAsync() override;
66 66
67 private: 67 private:
68 FRIEND_TEST_ALL_PREFIXES(ExtensionApiTest, 68 FRIEND_TEST_ALL_PREFIXES(ExtensionApiTest,
69 ContentSettingsGetResourceIdentifiers); 69 ContentSettingsGetResourceIdentifiers);
70 70
71 // Callback method that gets executed when |plugins| 71 // Callback method that gets executed when |plugins|
72 // are asynchronously fetched. 72 // are asynchronously fetched.
73 void OnGotPlugins(const std::vector<content::WebPluginInfo>& plugins); 73 void OnGotPlugins(const std::vector<content::WebPluginInfo>& plugins);
74 }; 74 };
75 75
76 } // namespace extensions 76 } // namespace extensions
77 77
78 #endif // CHROME_BROWSER_EXTENSIONS_API_CONTENT_SETTINGS_CONTENT_SETTINGS_API_H _ 78 #endif // CHROME_BROWSER_EXTENSIONS_API_CONTENT_SETTINGS_CONTENT_SETTINGS_API_H _
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698