OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 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 #include "chrome/browser/extensions/api/settings_private/settings_private_api.h" | |
6 | |
7 #include "extensions/browser/extension_function_registry.h" | |
8 | |
9 namespace extensions { | |
10 | |
11 //////////////////////////////////////////////////////////////////////////////// | |
12 // SettingsPrivateSetBooleanPrefFunction | |
13 | |
14 SettingsPrivateSetBooleanPrefFunction:: | |
15 ~SettingsPrivateSetBooleanPrefFunction() { | |
16 } | |
17 | |
18 bool SettingsPrivateSetBooleanPrefFunction::RunAsync() { | |
19 // TODO(orenb): Implement. | |
20 return true; | |
21 } | |
22 | |
23 void SettingsPrivateSetBooleanPrefFunction::Success() { | |
24 SendResponse(true); | |
michaelpg
2015/03/17 23:32:29
What is this for? ExtensionFunction says not to ca
Oren Blasberg
2015/03/17 23:44:45
IIRC, it's so that the js gets a 'success' respons
| |
25 } | |
26 | |
27 void SettingsPrivateSetBooleanPrefFunction::Failure(const std::string& error) { | |
28 error_ = error; | |
29 SendResponse(false); | |
30 } | |
31 | |
32 //////////////////////////////////////////////////////////////////////////////// | |
33 // SettingsPrivateSetNumericPrefFunction | |
34 | |
35 SettingsPrivateSetNumericPrefFunction:: | |
36 ~SettingsPrivateSetNumericPrefFunction() { | |
37 } | |
38 | |
39 bool SettingsPrivateSetNumericPrefFunction::RunAsync() { | |
40 // TODO(orenb): Implement. | |
41 return true; | |
42 } | |
43 | |
44 void SettingsPrivateSetNumericPrefFunction::Success() { | |
45 SendResponse(true); | |
46 } | |
47 | |
48 void SettingsPrivateSetNumericPrefFunction::Failure(const std::string& error) { | |
49 error_ = error; | |
50 SendResponse(false); | |
51 } | |
52 | |
53 //////////////////////////////////////////////////////////////////////////////// | |
54 // SettingsPrivateSetStringPrefFunction | |
55 | |
56 SettingsPrivateSetStringPrefFunction:: | |
57 ~SettingsPrivateSetStringPrefFunction() { | |
58 } | |
59 | |
60 bool SettingsPrivateSetStringPrefFunction::RunAsync() { | |
61 // TODO(orenb): Implement. | |
62 return true; | |
63 } | |
64 | |
65 void SettingsPrivateSetStringPrefFunction::Success() { | |
66 SendResponse(true); | |
67 } | |
68 | |
69 void SettingsPrivateSetStringPrefFunction::Failure(const std::string& error) { | |
70 error_ = error; | |
71 SendResponse(false); | |
72 } | |
73 | |
74 //////////////////////////////////////////////////////////////////////////////// | |
75 // SettingsPrivateGetAllPrefsFunction | |
76 | |
77 SettingsPrivateGetAllPrefsFunction::~SettingsPrivateGetAllPrefsFunction() { | |
78 } | |
79 | |
80 bool SettingsPrivateGetAllPrefsFunction::RunAsync() { | |
81 // TODO(orenb): Implement. | |
82 return true; | |
83 } | |
84 | |
85 void SettingsPrivateGetAllPrefsFunction::Success( | |
86 scoped_ptr<base::DictionaryValue> result) { | |
87 SendResponse(true); | |
88 } | |
89 | |
90 void SettingsPrivateGetAllPrefsFunction::Failure(const std::string& error) { | |
91 error_ = error; | |
92 SendResponse(false); | |
93 } | |
94 | |
95 } // namespace extensions | |
OLD | NEW |