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

Unified Diff: extensions/browser/runtime_api_delegate.h

Issue 264743014: Move chrome.runtime to //extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: extensions/browser/runtime_api_delegate.h
diff --git a/extensions/browser/runtime_api_delegate.h b/extensions/browser/runtime_api_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..be3698f9e9acfb37a0af728ef341ddd61ca4fddd
--- /dev/null
+++ b/extensions/browser/runtime_api_delegate.h
@@ -0,0 +1,57 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef EXTENSIONS_BROWSER_RUNTIME_API_DELEGATE_H
+#define EXTENSIONS_BROWSER_RUNTIME_API_DELEGATE_H
+
+#include "base/callback.h"
+#include "base/version.h"
+#include "extensions/browser/api/runtime/runtime_api.h"
not at google - send to devlin 2014/05/05 19:26:15 odd having a circular dependency like this, even i
+#include "extensions/common/api/runtime.h"
+
+class GURL;
+
+namespace extensions {
+
+class Extension;
+class UpdateObserver;
+
not at google - send to devlin 2014/05/05 19:26:15 comment
Ken Rockot(use gerrit already) 2014/05/05 21:08:07 Done.
+class RuntimeAPIDelegate {
+ public:
+ // Registers an UpdateObserver on behalf of the runtime API.
+ virtual void RegisterUpdateObserver(UpdateObserver* observer) = 0;
not at google - send to devlin 2014/05/05 19:26:15 you're right -- it's odd that you need to do this,
Ken Rockot(use gerrit already) 2014/05/05 21:08:07 It's a good rant :) I think I'd like to defer on
+
+ // Unregisters an UpdateObserver on behalf of the runtime API.
+ virtual void UnregisterUpdateObserver(UpdateObserver* observer) = 0;
+
+ // Determines an extension's previously installed version if applicable.
+ virtual base::Version GetOldExtensionVersion(const Extension* extension) = 0;
not at google - send to devlin 2014/05/05 19:26:15 the comment uses "previously" which is a better na
Ken Rockot(use gerrit already) 2014/05/05 21:08:07 Done.
+
+ // Reloads an extension if possible.
+ virtual void MaybeReloadExtension(const std::string& extension_id) = 0;
not at google - send to devlin 2014/05/05 19:26:15 What does it mean "if possible"? why "maybe"? It's
Ken Rockot(use gerrit already) 2014/05/05 21:08:07 Yeah, I realized that after I uploaded too... Done
+
+ // Requests an extensions update update check. Returns |false| if updates
+ // are disabled. Otherwise |callback| is called with the result of the
+ // update check.
+ virtual bool RequestUpdateCheck(
not at google - send to devlin 2014/05/05 19:26:15 "request" is implicit because you're calling it. "
Ken Rockot(use gerrit already) 2014/05/05 21:08:07 Done.
+ const std::string& extension_id,
+ const RuntimeAPI::UpdateCheckCallback& callback) = 0;
not at google - send to devlin 2014/05/05 19:26:15 seems like UpdateCheckCallback (and its struct) sh
Ken Rockot(use gerrit already) 2014/05/05 21:08:07 Yeah that's where they started. I have no idea why
+
+ // Handles uninstallation if the uninstalled extension provides an uninstall
+ // URL.
+ virtual void HandleUninstall(const std::string& extension_id,
not at google - send to devlin 2014/05/05 19:26:15 "Handle uninstall" is an odd way to phrase this. i
Ken Rockot(use gerrit already) 2014/05/05 21:08:07 Renamed to OpenURL as discussed.
+ const GURL& uninstall_url) = 0;
+
+ // Populates platform info to be provided by the getPlatformInfo function.
+ // Returns false iff no info is provided.
+ virtual bool GetPlatformInfo(
+ core_api::runtime::GetPlatformInfo::Results::PlatformInfo* info) = 0;
+
+ // Request a restart of the host device.
+ virtual bool RequestRestart(std::string* error_message) = 0;
not at google - send to devlin 2014/05/05 19:26:15 what does the return value mean? also: RestartDev
Ken Rockot(use gerrit already) 2014/05/05 21:08:07 Done.
+};
+
+} // namespace extensions
+
+#endif // EXTENSIONS_BROWSER_RUNTIME_API_DELEGATE_H

Powered by Google App Engine
This is Rietveld 408576698