OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "apps/shell/browser/shell_runtime_api_delegate.h" |
| 6 |
| 7 #if defined(OS_CHROMEOS) |
| 8 #include "chromeos/dbus/dbus_thread_manager.h" |
| 9 #include "chromeos/dbus/power_manager_client.h" |
| 10 #endif |
| 11 |
| 12 using extensions::core_api::runtime::GetPlatformInfo::Results::PlatformInfo; |
| 13 |
| 14 namespace apps { |
| 15 |
| 16 void ShellRuntimeAPIDelegate::RegisterUpdateObserver( |
| 17 extensions::UpdateObserver* observer) { |
| 18 } |
| 19 |
| 20 void ShellRuntimeAPIDelegate::UnregisterUpdateObserver( |
| 21 extensions::UpdateObserver* observer) { |
| 22 } |
| 23 |
| 24 base::Version ShellRuntimeAPIDelegate::GetOldExtensionVersion( |
| 25 const extensions::Extension* extension) { |
| 26 return base::Version(); |
| 27 } |
| 28 |
| 29 void ShellRuntimeAPIDelegate::MaybeReloadExtension( |
| 30 const std::string& extension_id) { |
| 31 } |
| 32 |
| 33 bool ShellRuntimeAPIDelegate::RequestUpdateCheck( |
| 34 const std::string& extension_id, |
| 35 const extensions::RuntimeAPI::UpdateCheckCallback& callback) { |
| 36 return false; |
| 37 } |
| 38 |
| 39 void ShellRuntimeAPIDelegate::HandleUninstall(const std::string& extension_id, |
| 40 const GURL& uninstall_url) { |
| 41 } |
| 42 |
| 43 bool ShellRuntimeAPIDelegate::GetPlatformInfo(PlatformInfo* info) { |
| 44 info->os = PlatformInfo::OS_CROS_; |
| 45 return true; |
| 46 } |
| 47 |
| 48 bool ShellRuntimeAPIDelegate::RequestRestart(std::string* error_message) { |
| 49 // We allow chrome.runtime.restart() to request a device restart on ChromeOS. |
| 50 #if defined(OS_CHROMEOS) |
| 51 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->RequestRestart(); |
| 52 return true; |
| 53 #endif |
| 54 *error_message = "Restart is only supported on ChromeOS."; |
| 55 return false; |
| 56 } |
| 57 |
| 58 } // namespace apps |
OLD | NEW |