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/autotest_private/autotest_private_api.h" | 5 #include "chrome/browser/extensions/api/autotest_private/autotest_private_api.h" |
6 | 6 |
7 #include "chrome/browser/extensions/api/autotest_private/autotest_private_api_fa
ctory.h" | 7 #include "chrome/browser/extensions/api/autotest_private/autotest_private_api_fa
ctory.h" |
8 #include "chrome/browser/extensions/extension_function_registry.h" | 8 #include "chrome/browser/extensions/extension_function_registry.h" |
9 #include "chrome/browser/lifetime/application_lifetime.h" | 9 #include "chrome/browser/lifetime/application_lifetime.h" |
10 #include "chrome/common/extensions/api/autotest_private.h" | 10 #include "chrome/common/extensions/api/autotest_private.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 return true; | 81 return true; |
82 } | 82 } |
83 | 83 |
84 bool AutotestPrivateLoginStatusFunction::RunImpl() { | 84 bool AutotestPrivateLoginStatusFunction::RunImpl() { |
85 DVLOG(1) << "AutotestPrivateLoginStatusFunction"; | 85 DVLOG(1) << "AutotestPrivateLoginStatusFunction"; |
86 SetResult(base::Value::CreateStringValue(GetUserLoginStatus())); | 86 SetResult(base::Value::CreateStringValue(GetUserLoginStatus())); |
87 return true; | 87 return true; |
88 } | 88 } |
89 | 89 |
90 AutotestPrivateAPI::AutotestPrivateAPI() : test_mode_(false) { | 90 AutotestPrivateAPI::AutotestPrivateAPI() : test_mode_(false) { |
91 ExtensionFunctionRegistry* registry = | |
92 ExtensionFunctionRegistry::GetInstance(); | |
93 registry->RegisterFunction<AutotestPrivateLogoutFunction>(); | |
94 registry->RegisterFunction<AutotestPrivateRestartFunction>(); | |
95 registry->RegisterFunction<AutotestPrivateShutdownFunction>(); | |
96 registry->RegisterFunction<AutotestPrivateLoginStatusFunction>(); | |
97 } | 91 } |
98 | 92 |
99 AutotestPrivateAPI::~AutotestPrivateAPI() { | 93 AutotestPrivateAPI::~AutotestPrivateAPI() { |
100 } | 94 } |
101 | 95 |
102 } // namespace extensions | 96 } // namespace extensions |
OLD | NEW |