OLD | NEW |
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 #include "chrome/browser/extensions/api/test/test_api.h" | 5 #include "chrome/browser/extensions/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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 content::NotificationService::current()->Notify( | 110 content::NotificationService::current()->Notify( |
111 chrome::NOTIFICATION_EXTENSION_TEST_MESSAGE, | 111 chrome::NOTIFICATION_EXTENSION_TEST_MESSAGE, |
112 content::Source<TestSendMessageFunction>(this), | 112 content::Source<TestSendMessageFunction>(this), |
113 content::Details<std::string>(¶ms->message)); | 113 content::Details<std::string>(¶ms->message)); |
114 return true; | 114 return true; |
115 } | 115 } |
116 | 116 |
117 TestSendMessageFunction::~TestSendMessageFunction() {} | 117 TestSendMessageFunction::~TestSendMessageFunction() {} |
118 | 118 |
119 void TestSendMessageFunction::Reply(const std::string& message) { | 119 void TestSendMessageFunction::Reply(const std::string& message) { |
120 SetResult(Value::CreateStringValue(message)); | 120 SetResult(new base::StringValue(message)); |
121 SendResponse(true); | 121 SendResponse(true); |
122 Release(); // balanced in RunImpl | 122 Release(); // balanced in RunImpl |
123 } | 123 } |
124 | 124 |
125 // static | 125 // static |
126 void TestGetConfigFunction::set_test_config_state( | 126 void TestGetConfigFunction::set_test_config_state( |
127 base::DictionaryValue* value) { | 127 base::DictionaryValue* value) { |
128 TestConfigState* test_config_state = TestConfigState::GetInstance(); | 128 TestConfigState* test_config_state = TestConfigState::GetInstance(); |
129 test_config_state->set_config_state(value); | 129 test_config_state->set_config_state(value); |
130 } | 130 } |
(...skipping 15 matching lines...) Expand all Loading... |
146 if (!test_config_state->config_state()) { | 146 if (!test_config_state->config_state()) { |
147 error_ = kNoTestConfigDataError; | 147 error_ = kNoTestConfigDataError; |
148 return false; | 148 return false; |
149 } | 149 } |
150 | 150 |
151 SetResult(test_config_state->config_state()->DeepCopy()); | 151 SetResult(test_config_state->config_state()->DeepCopy()); |
152 return true; | 152 return true; |
153 } | 153 } |
154 | 154 |
155 } // namespace extensions | 155 } // namespace extensions |
OLD | NEW |