| 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/system_private/system_private_api.h" | 5 #include "chrome/browser/extensions/api/system_private/system_private_api.h" |
| 6 | 6 |
| 7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/extensions/event_router_forwarder.h" | 10 #include "chrome/browser/extensions/event_router_forwarder.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 } // namespace | 60 } // namespace |
| 61 | 61 |
| 62 namespace extensions { | 62 namespace extensions { |
| 63 | 63 |
| 64 bool SystemPrivateGetIncognitoModeAvailabilityFunction::RunImpl() { | 64 bool SystemPrivateGetIncognitoModeAvailabilityFunction::RunImpl() { |
| 65 PrefService* prefs = profile_->GetPrefs(); | 65 PrefService* prefs = profile_->GetPrefs(); |
| 66 int value = prefs->GetInteger(prefs::kIncognitoModeAvailability); | 66 int value = prefs->GetInteger(prefs::kIncognitoModeAvailability); |
| 67 EXTENSION_FUNCTION_VALIDATE( | 67 EXTENSION_FUNCTION_VALIDATE( |
| 68 value >= 0 && | 68 value >= 0 && |
| 69 value < static_cast<int>(arraysize(kIncognitoModeAvailabilityStrings))); | 69 value < static_cast<int>(arraysize(kIncognitoModeAvailabilityStrings))); |
| 70 SetResult(Value::CreateStringValue(kIncognitoModeAvailabilityStrings[value])); | 70 SetResult(new base::StringValue(kIncognitoModeAvailabilityStrings[value])); |
| 71 return true; | 71 return true; |
| 72 } | 72 } |
| 73 | 73 |
| 74 bool SystemPrivateGetUpdateStatusFunction::RunImpl() { | 74 bool SystemPrivateGetUpdateStatusFunction::RunImpl() { |
| 75 std::string state; | 75 std::string state; |
| 76 double download_progress = 0; | 76 double download_progress = 0; |
| 77 #if defined(OS_CHROMEOS) | 77 #if defined(OS_CHROMEOS) |
| 78 // With UpdateEngineClient, we can provide more detailed information about | 78 // With UpdateEngineClient, we can provide more detailed information about |
| 79 // system updates on ChromeOS. | 79 // system updates on ChromeOS. |
| 80 const chromeos::UpdateEngineClient::Status status = | 80 const chromeos::UpdateEngineClient::Status status = |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 | 148 |
| 149 void DispatchScreenUnlockedEvent() { | 149 void DispatchScreenUnlockedEvent() { |
| 150 DispatchEvent(kOnScreenUnlocked, NULL); | 150 DispatchEvent(kOnScreenUnlocked, NULL); |
| 151 } | 151 } |
| 152 | 152 |
| 153 void DispatchWokeUpEvent() { | 153 void DispatchWokeUpEvent() { |
| 154 DispatchEvent(kOnWokeUp, NULL); | 154 DispatchEvent(kOnWokeUp, NULL); |
| 155 } | 155 } |
| 156 | 156 |
| 157 } // namespace extensions | 157 } // namespace extensions |
| OLD | NEW |