| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/extension_test_api.h" | 5 #include "chrome/browser/extensions/extension_test_api.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "chrome/browser/extensions/extensions_service.h" | 9 #include "chrome/browser/extensions/extensions_service.h" |
| 10 #include "chrome/browser/extensions/extensions_quota_service.h" | 10 #include "chrome/browser/extensions/extensions_quota_service.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 | 86 |
| 87 void ExtensionTestSendMessageFunction::Reply(const std::string& message) { | 87 void ExtensionTestSendMessageFunction::Reply(const std::string& message) { |
| 88 result_.reset(Value::CreateStringValue(message)); | 88 result_.reset(Value::CreateStringValue(message)); |
| 89 SendResponse(true); | 89 SendResponse(true); |
| 90 Release(); // balanced in RunImpl | 90 Release(); // balanced in RunImpl |
| 91 } | 91 } |
| 92 | 92 |
| 93 // static | 93 // static |
| 94 void ExtensionTestGetConfigFunction::set_test_config_state( | 94 void ExtensionTestGetConfigFunction::set_test_config_state( |
| 95 DictionaryValue* value) { | 95 DictionaryValue* value) { |
| 96 TestConfigState* test_config_state = Singleton<TestConfigState>::get(); | 96 TestConfigState* test_config_state = TestConfigState::GetInstance(); |
| 97 test_config_state->set_config_state(value); | 97 test_config_state->set_config_state(value); |
| 98 } | 98 } |
| 99 | 99 |
| 100 ExtensionTestGetConfigFunction::TestConfigState::TestConfigState() | 100 ExtensionTestGetConfigFunction::TestConfigState::TestConfigState() |
| 101 : config_state_(NULL) {} | 101 : config_state_(NULL) {} |
| 102 | 102 |
| 103 // static |
| 104 ExtensionTestGetConfigFunction::TestConfigState* |
| 105 ExtensionTestGetConfigFunction::TestConfigState::GetInstance() { |
| 106 return Singleton<TestConfigState>::get(); |
| 107 } |
| 108 |
| 103 ExtensionTestGetConfigFunction::~ExtensionTestGetConfigFunction() {} | 109 ExtensionTestGetConfigFunction::~ExtensionTestGetConfigFunction() {} |
| 104 | 110 |
| 105 bool ExtensionTestGetConfigFunction::RunImpl() { | 111 bool ExtensionTestGetConfigFunction::RunImpl() { |
| 106 TestConfigState* test_config_state = Singleton<TestConfigState>::get(); | 112 TestConfigState* test_config_state = TestConfigState::GetInstance(); |
| 107 | 113 |
| 108 if (!test_config_state->config_state()) { | 114 if (!test_config_state->config_state()) { |
| 109 error_ = kNoTestConfigDataError; | 115 error_ = kNoTestConfigDataError; |
| 110 return false; | 116 return false; |
| 111 } | 117 } |
| 112 | 118 |
| 113 result_.reset(test_config_state->config_state()->DeepCopy()); | 119 result_.reset(test_config_state->config_state()->DeepCopy()); |
| 114 return true; | 120 return true; |
| 115 } | 121 } |
| OLD | NEW |