OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/runtime/chrome_runtime_api_delegate.h" | 5 #include "chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.h" |
6 | 6 |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 } else { | 223 } else { |
224 NOTREACHED(); | 224 NOTREACHED(); |
225 return false; | 225 return false; |
226 } | 226 } |
227 | 227 |
228 return true; | 228 return true; |
229 } | 229 } |
230 | 230 |
231 bool ChromeRuntimeAPIDelegate::RestartDevice(std::string* error_message) { | 231 bool ChromeRuntimeAPIDelegate::RestartDevice(std::string* error_message) { |
232 #if defined(OS_CHROMEOS) | 232 #if defined(OS_CHROMEOS) |
233 if (chromeos::UserManager::Get()->IsLoggedInAsKioskApp()) { | 233 if (chromeos::GetUserManager()->IsLoggedInAsKioskApp()) { |
234 chromeos::DBusThreadManager::Get() | 234 chromeos::DBusThreadManager::Get() |
235 ->GetPowerManagerClient() | 235 ->GetPowerManagerClient() |
236 ->RequestRestart(); | 236 ->RequestRestart(); |
237 return true; | 237 return true; |
238 } | 238 } |
239 #endif | 239 #endif |
240 *error_message = "Function available only for ChromeOS kiosk mode."; | 240 *error_message = "Function available only for ChromeOS kiosk mode."; |
241 return false; | 241 return false; |
242 } | 242 } |
243 | 243 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 const UpdateCheckResult& result) { | 275 const UpdateCheckResult& result) { |
276 UpdateCallbackList callbacks = pending_update_checks_[extension_id]; | 276 UpdateCallbackList callbacks = pending_update_checks_[extension_id]; |
277 pending_update_checks_.erase(extension_id); | 277 pending_update_checks_.erase(extension_id); |
278 for (UpdateCallbackList::const_iterator iter = callbacks.begin(); | 278 for (UpdateCallbackList::const_iterator iter = callbacks.begin(); |
279 iter != callbacks.end(); | 279 iter != callbacks.end(); |
280 ++iter) { | 280 ++iter) { |
281 const UpdateCheckCallback& callback = *iter; | 281 const UpdateCheckCallback& callback = *iter; |
282 callback.Run(result); | 282 callback.Run(result); |
283 } | 283 } |
284 } | 284 } |
OLD | NEW |