| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 } |
| 52 | 52 |
| 53 bool AutotestPrivateLoginStatusFunction::RunImpl() { | 53 bool AutotestPrivateLoginStatusFunction::RunImpl() { |
| 54 DVLOG(1) << "AutotestPrivateLoginStatusFunction"; | 54 DVLOG(1) << "AutotestPrivateLoginStatusFunction"; |
| 55 | 55 |
| 56 DictionaryValue* result(new DictionaryValue); | 56 base::DictionaryValue* result(new base::DictionaryValue); |
| 57 #if defined(OS_CHROMEOS) | 57 #if defined(OS_CHROMEOS) |
| 58 const chromeos::UserManager* user_manager = chromeos::UserManager::Get(); | 58 const chromeos::UserManager* user_manager = chromeos::UserManager::Get(); |
| 59 const bool is_screen_locked = | 59 const bool is_screen_locked = |
| 60 !!chromeos::ScreenLocker::default_screen_locker(); | 60 !!chromeos::ScreenLocker::default_screen_locker(); |
| 61 | 61 |
| 62 if (user_manager) { | 62 if (user_manager) { |
| 63 result->SetBoolean("isLoggedIn", user_manager->IsUserLoggedIn()); | 63 result->SetBoolean("isLoggedIn", user_manager->IsUserLoggedIn()); |
| 64 result->SetBoolean("isOwner", user_manager->IsCurrentUserOwner()); | 64 result->SetBoolean("isOwner", user_manager->IsCurrentUserOwner()); |
| 65 result->SetBoolean("isScreenLocked", is_screen_locked); | 65 result->SetBoolean("isScreenLocked", is_screen_locked); |
| 66 if (user_manager->IsUserLoggedIn()) { | 66 if (user_manager->IsUserLoggedIn()) { |
| (...skipping 29 matching lines...) Expand all 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 |