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

Side by Side Diff: extensions/browser/api/test/test_api.h

Issue 404883002: Allow extension APIs to be called from WebUI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: android compile Created 6 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 EXTENSIONS_BROWSER_API_TEST_TEST_API_H_ 5 #ifndef EXTENSIONS_BROWSER_API_TEST_TEST_API_H_
6 #define EXTENSIONS_BROWSER_API_TEST_TEST_API_H_ 6 #define EXTENSIONS_BROWSER_API_TEST_TEST_API_H_
7 7
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "extensions/browser/extension_function.h" 9 #include "extensions/browser/extension_function.h"
10 10
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 }; 70 };
71 71
72 class TestSendMessageFunction : public AsyncExtensionFunction { 72 class TestSendMessageFunction : public AsyncExtensionFunction {
73 public: 73 public:
74 DECLARE_EXTENSION_FUNCTION("test.sendMessage", UNKNOWN) 74 DECLARE_EXTENSION_FUNCTION("test.sendMessage", UNKNOWN)
75 75
76 // Sends a reply back to the calling extension. Many extensions don't need 76 // Sends a reply back to the calling extension. Many extensions don't need
77 // a reply and will just ignore it. 77 // a reply and will just ignore it.
78 void Reply(const std::string& message); 78 void Reply(const std::string& message);
79 79
80 // Sends an error back to the calling extension.
81 void ReplyWithError(const std::string& error);
82
80 protected: 83 protected:
81 virtual ~TestSendMessageFunction(); 84 virtual ~TestSendMessageFunction();
82 85
83 // ExtensionFunction: 86 // ExtensionFunction:
84 virtual bool RunAsync() OVERRIDE; 87 virtual bool RunAsync() OVERRIDE;
85 }; 88 };
86 89
87 class TestGetConfigFunction : public TestExtensionFunction { 90 class TestGetConfigFunction : public TestExtensionFunction {
88 public: 91 public:
89 DECLARE_EXTENSION_FUNCTION("test.getConfig", UNKNOWN) 92 DECLARE_EXTENSION_FUNCTION("test.getConfig", UNKNOWN)
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 protected: 132 protected:
130 virtual ~TestWaitForRoundTripFunction(); 133 virtual ~TestWaitForRoundTripFunction();
131 134
132 // TestExtensionFunction: 135 // TestExtensionFunction:
133 virtual bool RunSafe() OVERRIDE; 136 virtual bool RunSafe() OVERRIDE;
134 }; 137 };
135 138
136 } // namespace extensions 139 } // namespace extensions
137 140
138 #endif // EXTENSIONS_BROWSER_API_TEST_TEST_API_H_ 141 #endif // EXTENSIONS_BROWSER_API_TEST_TEST_API_H_
OLDNEW
« no previous file with comments | « content/public/browser/child_process_security_policy.h ('k') | extensions/browser/api/test/test_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698