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

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

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, 5 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
« no previous file with comments | « extensions/browser/api/test/test_api.h ('k') | extensions/browser/event_router.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "extensions/browser/api/test/test_api.h" 5 #include "extensions/browser/api/test/test_api.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/memory/singleton.h" 10 #include "base/memory/singleton.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 return true; 97 return true;
98 } 98 }
99 99
100 TestSendMessageFunction::~TestSendMessageFunction() {} 100 TestSendMessageFunction::~TestSendMessageFunction() {}
101 101
102 void TestSendMessageFunction::Reply(const std::string& message) { 102 void TestSendMessageFunction::Reply(const std::string& message) {
103 SetResult(new base::StringValue(message)); 103 SetResult(new base::StringValue(message));
104 SendResponse(true); 104 SendResponse(true);
105 } 105 }
106 106
107 void TestSendMessageFunction::ReplyWithError(const std::string& error) {
108 error_ = error;
109 SendResponse(false);
110 }
111
107 // static 112 // static
108 void TestGetConfigFunction::set_test_config_state( 113 void TestGetConfigFunction::set_test_config_state(
109 base::DictionaryValue* value) { 114 base::DictionaryValue* value) {
110 TestConfigState* test_config_state = TestConfigState::GetInstance(); 115 TestConfigState* test_config_state = TestConfigState::GetInstance();
111 test_config_state->set_config_state(value); 116 test_config_state->set_config_state(value);
112 } 117 }
113 118
114 TestGetConfigFunction::TestConfigState::TestConfigState() 119 TestGetConfigFunction::TestConfigState::TestConfigState()
115 : config_state_(NULL) {} 120 : config_state_(NULL) {}
116 121
(...skipping 20 matching lines...) Expand all
137 TestWaitForRoundTripFunction::~TestWaitForRoundTripFunction() {} 142 TestWaitForRoundTripFunction::~TestWaitForRoundTripFunction() {}
138 143
139 bool TestWaitForRoundTripFunction::RunSafe() { 144 bool TestWaitForRoundTripFunction::RunSafe() {
140 scoped_ptr<WaitForRoundTrip::Params> params( 145 scoped_ptr<WaitForRoundTrip::Params> params(
141 WaitForRoundTrip::Params::Create(*args_)); 146 WaitForRoundTrip::Params::Create(*args_));
142 SetResult(new base::StringValue(params->message)); 147 SetResult(new base::StringValue(params->message));
143 return true; 148 return true;
144 } 149 }
145 150
146 } // namespace extensions 151 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/test/test_api.h ('k') | extensions/browser/event_router.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698