Chromium Code Reviews| 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 | |
|
James Cook
2014/05/06 15:57:03
#include PlatformInfo since you use it
Ken Rockot(use gerrit already)
2014/05/06 17:22:23
Done.
| |
| 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::AddUpdateObserver( | |
| 17 extensions::UpdateObserver* observer) { | |
| 18 } | |
| 19 | |
| 20 void ShellRuntimeAPIDelegate::RemoveUpdateObserver( | |
| 21 extensions::UpdateObserver* observer) { | |
| 22 } | |
| 23 | |
| 24 base::Version ShellRuntimeAPIDelegate::GetPreviousExtensionVersion( | |
| 25 const extensions::Extension* extension) { | |
| 26 return base::Version(); | |
| 27 } | |
| 28 | |
| 29 void ShellRuntimeAPIDelegate::ReloadExtension(const std::string& extension_id) { | |
| 30 } | |
| 31 | |
| 32 bool ShellRuntimeAPIDelegate::CheckForUpdates( | |
| 33 const std::string& extension_id, | |
| 34 const UpdateCheckCallback& callback) { | |
| 35 return false; | |
| 36 } | |
| 37 | |
| 38 void ShellRuntimeAPIDelegate::OpenURL(const GURL& uninstall_url) { | |
| 39 } | |
| 40 | |
| 41 bool ShellRuntimeAPIDelegate::GetPlatformInfo(PlatformInfo* info) { | |
| 42 info->os = PlatformInfo::OS_CROS_; | |
|
James Cook
2014/05/06 15:57:03
Maybe ifdef OS_CHROMEOS and otherwise return Linux
Ken Rockot(use gerrit already)
2014/05/06 17:22:23
Done.
| |
| 43 return true; | |
| 44 } | |
| 45 | |
| 46 bool ShellRuntimeAPIDelegate::RestartDevice(std::string* error_message) { | |
| 47 // We allow chrome.runtime.restart() to request a device restart on ChromeOS. | |
| 48 #if defined(OS_CHROMEOS) | |
| 49 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->RequestRestart(); | |
| 50 return true; | |
| 51 #endif | |
| 52 *error_message = "Restart is only supported on ChromeOS."; | |
| 53 return false; | |
| 54 } | |
| 55 | |
| 56 } // namespace apps | |
| OLD | NEW |