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 "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
8 #include "chrome/browser/extensions/api/autotest_private/autotest_private_api_fa
ctory.h" | 8 #include "chrome/browser/extensions/api/autotest_private/autotest_private_api_fa
ctory.h" |
9 #include "chrome/browser/extensions/extension_function_registry.h" | 9 #include "chrome/browser/extensions/extension_function_registry.h" |
10 #include "chrome/browser/lifetime/application_lifetime.h" | 10 #include "chrome/browser/lifetime/application_lifetime.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 return true; | 31 return true; |
32 } | 32 } |
33 | 33 |
34 bool AutotestPrivateShutdownFunction::RunImpl() { | 34 bool AutotestPrivateShutdownFunction::RunImpl() { |
35 scoped_ptr<api::autotest_private::Shutdown::Params> params( | 35 scoped_ptr<api::autotest_private::Shutdown::Params> params( |
36 api::autotest_private::Shutdown::Params::Create(*args_)); | 36 api::autotest_private::Shutdown::Params::Create(*args_)); |
37 EXTENSION_FUNCTION_VALIDATE(params.get()); | 37 EXTENSION_FUNCTION_VALIDATE(params.get()); |
38 | 38 |
39 DVLOG(1) << "AutotestPrivateShutdownFunction " << params->force; | 39 DVLOG(1) << "AutotestPrivateShutdownFunction " << params->force; |
40 | 40 |
41 #if defined(OS_CHROME) | 41 #if defined(OS_CHROMEOS) |
42 if (params->force) { | 42 if (params->force) { |
43 if (!AutotestPrivateAPIFactory::GetForProfile(profile())->test_mode()) | 43 if (!AutotestPrivateAPIFactory::GetForProfile(profile())->test_mode()) |
44 chrome::ExitCleanly(); | 44 chrome::ExitCleanly(); |
45 return true; | 45 return true; |
46 } | 46 } |
47 #endif | 47 #endif |
48 if (!AutotestPrivateAPIFactory::GetForProfile(profile())->test_mode()) | 48 if (!AutotestPrivateAPIFactory::GetForProfile(profile())->test_mode()) |
49 chrome::AttemptExit(); | 49 chrome::AttemptExit(); |
50 return true; | 50 return true; |
51 } | 51 } |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 return true; | 96 return true; |
97 } | 97 } |
98 | 98 |
99 AutotestPrivateAPI::AutotestPrivateAPI() : test_mode_(false) { | 99 AutotestPrivateAPI::AutotestPrivateAPI() : test_mode_(false) { |
100 } | 100 } |
101 | 101 |
102 AutotestPrivateAPI::~AutotestPrivateAPI() { | 102 AutotestPrivateAPI::~AutotestPrivateAPI() { |
103 } | 103 } |
104 | 104 |
105 } // namespace extensions | 105 } // namespace extensions |
OLD | NEW |