Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(639)

Side by Side Diff: apps/shell/browser/shell_runtime_api_delegate.cc

Issue 264743014: Move chrome.runtime to //extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698