| 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 "apps/shell/browser/shell_runtime_api_delegate.h" | 5 #include "extensions/shell/browser/shell_runtime_api_delegate.h" |
| 6 | 6 |
| 7 #include "extensions/common/api/runtime.h" | 7 #include "extensions/common/api/runtime.h" |
| 8 | 8 |
| 9 #if defined(OS_CHROMEOS) | 9 #if defined(OS_CHROMEOS) |
| 10 #include "chromeos/dbus/dbus_thread_manager.h" | 10 #include "chromeos/dbus/dbus_thread_manager.h" |
| 11 #include "chromeos/dbus/power_manager_client.h" | 11 #include "chromeos/dbus/power_manager_client.h" |
| 12 #endif | 12 #endif |
| 13 | 13 |
| 14 using extensions::core_api::runtime::PlatformInfo; | 14 using extensions::core_api::runtime::PlatformInfo; |
| 15 | 15 |
| 16 namespace apps { | 16 namespace extensions { |
| 17 | 17 |
| 18 ShellRuntimeAPIDelegate::ShellRuntimeAPIDelegate() { | 18 ShellRuntimeAPIDelegate::ShellRuntimeAPIDelegate() { |
| 19 } | 19 } |
| 20 | 20 |
| 21 ShellRuntimeAPIDelegate::~ShellRuntimeAPIDelegate() { | 21 ShellRuntimeAPIDelegate::~ShellRuntimeAPIDelegate() { |
| 22 } | 22 } |
| 23 | 23 |
| 24 void ShellRuntimeAPIDelegate::AddUpdateObserver( | 24 void ShellRuntimeAPIDelegate::AddUpdateObserver(UpdateObserver* observer) { |
| 25 extensions::UpdateObserver* observer) { | |
| 26 } | 25 } |
| 27 | 26 |
| 28 void ShellRuntimeAPIDelegate::RemoveUpdateObserver( | 27 void ShellRuntimeAPIDelegate::RemoveUpdateObserver(UpdateObserver* observer) { |
| 29 extensions::UpdateObserver* observer) { | |
| 30 } | 28 } |
| 31 | 29 |
| 32 base::Version ShellRuntimeAPIDelegate::GetPreviousExtensionVersion( | 30 base::Version ShellRuntimeAPIDelegate::GetPreviousExtensionVersion( |
| 33 const extensions::Extension* extension) { | 31 const Extension* extension) { |
| 34 return base::Version(); | 32 return base::Version(); |
| 35 } | 33 } |
| 36 | 34 |
| 37 void ShellRuntimeAPIDelegate::ReloadExtension(const std::string& extension_id) { | 35 void ShellRuntimeAPIDelegate::ReloadExtension(const std::string& extension_id) { |
| 38 } | 36 } |
| 39 | 37 |
| 40 bool ShellRuntimeAPIDelegate::CheckForUpdates( | 38 bool ShellRuntimeAPIDelegate::CheckForUpdates( |
| 41 const std::string& extension_id, | 39 const std::string& extension_id, |
| 42 const UpdateCheckCallback& callback) { | 40 const UpdateCheckCallback& callback) { |
| 43 return false; | 41 return false; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 58 bool ShellRuntimeAPIDelegate::RestartDevice(std::string* error_message) { | 56 bool ShellRuntimeAPIDelegate::RestartDevice(std::string* error_message) { |
| 59 // We allow chrome.runtime.restart() to request a device restart on ChromeOS. | 57 // We allow chrome.runtime.restart() to request a device restart on ChromeOS. |
| 60 #if defined(OS_CHROMEOS) | 58 #if defined(OS_CHROMEOS) |
| 61 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->RequestRestart(); | 59 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->RequestRestart(); |
| 62 return true; | 60 return true; |
| 63 #endif | 61 #endif |
| 64 *error_message = "Restart is only supported on ChromeOS."; | 62 *error_message = "Restart is only supported on ChromeOS."; |
| 65 return false; | 63 return false; |
| 66 } | 64 } |
| 67 | 65 |
| 68 } // namespace apps | 66 } // namespace extensions |
| OLD | NEW |