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

Side by Side Diff: extensions/browser/api/runtime/runtime_event_router.h

Issue 206613005: Extract RuntimeEventRouter from extensions Runtime API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove from android whitelist (runtime-api) Created 6 years, 9 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
« no previous file with comments | « extensions/browser/DEPS ('k') | extensions/browser/api/runtime/runtime_event_router.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef EXTENSIONS_BROWSER_API_RUNTIME_RUNTIME_EVENT_ROUTER_H_
6 #define EXTENSIONS_BROWSER_API_RUNTIME_RUNTIME_EVENT_ROUTER_H_
7
8 #include <string>
9
10 #include "base/macros.h"
11 #include "chrome/common/extensions/api/runtime.h"
12
13 namespace base {
14 class DictionaryValue;
15 class Version;
16 }
17
18 namespace content {
19 class BrowserContext;
20 };
21
22 namespace extensions {
23
24 // Dispatches events to extensions such as onStartup, onInstalled, etc.
25 class RuntimeEventRouter {
26 public:
27 // Dispatches the onStartup event to all currently-loaded extensions.
28 static void DispatchOnStartupEvent(content::BrowserContext* context,
29 const std::string& extension_id);
30
31 // Dispatches the onInstalled event to the given extension.
32 static void DispatchOnInstalledEvent(content::BrowserContext* context,
33 const std::string& extension_id,
34 const base::Version& old_version,
35 bool chrome_updated);
36
37 // Dispatches the onUpdateAvailable event to the given extension.
38 static void DispatchOnUpdateAvailableEvent(
39 content::BrowserContext* context,
40 const std::string& extension_id,
41 const base::DictionaryValue* manifest);
42
43 // Dispatches the onBrowserUpdateAvailable event to all extensions.
44 static void DispatchOnBrowserUpdateAvailableEvent(
45 content::BrowserContext* context);
46
47 // Dispatches the onRestartRequired event to the given app.
48 static void DispatchOnRestartRequiredEvent(
49 content::BrowserContext* context,
50 const std::string& app_id,
51 api::runtime::OnRestartRequired::Reason reason);
52
53 private:
54 DISALLOW_IMPLICIT_CONSTRUCTORS(RuntimeEventRouter);
55 };
56
57 } // namespace extensions
58
59 #endif // EXTENSIONS_BROWSER_API_RUNTIME_RUNTIME_EVENT_ROUTER_H_
OLDNEW
« no previous file with comments | « extensions/browser/DEPS ('k') | extensions/browser/api/runtime/runtime_event_router.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698