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

Side by Side Diff: chrome/browser/extensions/api/settings_private/settings_private_api.h

Issue 1015623005: chrome.settingsPrivate: Basic stub implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add stub implementations of the methods. Created 5 years, 9 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 2013 The Chromium Authors. All rights reserved.
michaelpg 2015/03/17 23:32:29 2015
Oren Blasberg 2015/03/17 23:44:45 Done.
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_API_SETTINGS_PRIVATE_SETTINGS_PRIVATE_API_H_
michaelpg 2015/03/17 23:32:29 nit: should be BROWSER_EXTENSIONS not EXTENISONS_B
Oren Blasberg 2015/03/17 23:44:45 Done.
6 #define EXTENSIONS_BROWSER_API_SETTINGS_PRIVATE_SETTINGS_PRIVATE_API_H_
7
8 #include <string>
9
10 #include "base/macros.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "base/values.h"
13 #include "extensions/browser/extension_function.h"
14
15 namespace extensions {
16
17 namespace settings_private {
James Hawkins 2015/03/17 23:28:42 This is empty; please remove.
Oren Blasberg 2015/03/17 23:44:45 Done.
18
19 } // namespace settings_private
20
21 // Implements the chrome.settingsPrivate.setBooleanPref method.
22 class SettingsPrivateSetBooleanPrefFunction : public AsyncExtensionFunction {
23 public:
24 SettingsPrivateSetBooleanPrefFunction() {}
25 DECLARE_EXTENSION_FUNCTION("settingsPrivate.setBooleanPref",
26 SETTINGSPRIVATE_SETBOOLEANPREF);
27
28 protected:
29 ~SettingsPrivateSetBooleanPrefFunction() override;
30
31 // AsyncExtensionFunction overrides.
32 bool RunAsync() override;
33
34 private:
35 void Success();
36 void Failure(const std::string& error_name);
37
38 DISALLOW_COPY_AND_ASSIGN(SettingsPrivateSetBooleanPrefFunction);
39 };
40
41 // Implements the chrome.settingsPrivate.setNumericPref method.
42 class SettingsPrivateSetNumericPrefFunction : public AsyncExtensionFunction {
43 public:
44 SettingsPrivateSetNumericPrefFunction() {}
45 DECLARE_EXTENSION_FUNCTION("settingsPrivate.setNumericPref",
46 SETTINGSPRIVATE_SETNUMERICPREF);
47
48 protected:
49 ~SettingsPrivateSetNumericPrefFunction() override;
50
51 // AsyncExtensionFunction overrides.
52 bool RunAsync() override;
53
54 private:
55 void Success();
56 void Failure(const std::string& error);
57
58 DISALLOW_COPY_AND_ASSIGN(SettingsPrivateSetNumericPrefFunction);
59 };
60
61 // Implements the chrome.settingsPrivate.setStringPref method.
62 class SettingsPrivateSetStringPrefFunction : public AsyncExtensionFunction {
63 public:
64 SettingsPrivateSetStringPrefFunction() {}
65 DECLARE_EXTENSION_FUNCTION("settingsPrivate.setStringPref",
66 SETTINGSPRIVATE_SETSTRINGPREF);
67
68 protected:
69 ~SettingsPrivateSetStringPrefFunction() override;
70
71 // AsyncExtensionFunction overrides.
72 bool RunAsync() override;
73
74 private:
75 void Success();
76 void Failure(const std::string& error);
77
78 DISALLOW_COPY_AND_ASSIGN(SettingsPrivateSetStringPrefFunction);
79 };
80
81 // Implements the chrome.settingsPrivate.getAllPrefs method.
82 class SettingsPrivateGetAllPrefsFunction : public AsyncExtensionFunction {
83 public:
84 SettingsPrivateGetAllPrefsFunction() {}
85 DECLARE_EXTENSION_FUNCTION("settingsPrivate.getAllPrefs",
86 SETTINGSPRIVATE_GETALLPREFS);
87
88 protected:
89 ~SettingsPrivateGetAllPrefsFunction() override;
90
91 // AsyncExtensionFunction overrides.
92 bool RunAsync() override;
93
94 private:
95 void Success(scoped_ptr<base::DictionaryValue> result);
96 void Failure(const std::string& error);
97
98 DISALLOW_COPY_AND_ASSIGN(SettingsPrivateGetAllPrefsFunction);
99 };
100
101 } // namespace extensions
102
103 #endif // EXTENSIONS_BROWSER_API_SETTINGS_PRIVATE_SETTINGS_PRIVATE_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698