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

Side by Side Diff: chrome/browser/extensions/api/runtime/runtime_api.h

Issue 10941003: Reset registered events and dispatch runtime.onInstalled to all extensions when (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ? Created 8 years, 3 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_EXTENSIONS_API_RUNTIME_RUNTIME_API_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_RUNTIME_RUNTIME_API_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_RUNTIME_RUNTIME_API_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_RUNTIME_RUNTIME_API_H_
7 7
8 #include "chrome/browser/extensions/extension_function.h" 8 #include "chrome/browser/extensions/extension_function.h"
9 9
10 class Profile; 10 class Profile;
11 class Version; 11 class Version;
12 12
13 namespace extensions { 13 namespace extensions {
14 class Extension; 14 class Extension;
15 class ExtensionHost; 15 class ExtensionHost;
16 16
17 class RuntimeEventRouter { 17 class RuntimeEventRouter {
18 public: 18 public:
19 // Dispatches the onStartup event to all currently-loaded extensions. 19 // Dispatches the onStartup event to all currently-loaded extensions.
20 static void DispatchOnStartupEvent(Profile* profile, 20 static void DispatchOnStartupEvent(Profile* profile,
21 const std::string& extension_id); 21 const std::string& extension_id);
22 22
23 // Dispatches the onInstalled event to the given extension. 23 // Dispatches the onInstalled event to the given extension.
24 static void DispatchOnInstalledEvent(Profile* profile, 24 static void DispatchOnInstalledEvent(Profile* profile,
25 const std::string& extension_id, 25 const std::string& extension_id,
26 const Version& old_version); 26 const Version& old_version,
27 bool chrome_updated);
27 }; 28 };
28 29
29 class RuntimeGetBackgroundPageFunction : public AsyncExtensionFunction { 30 class RuntimeGetBackgroundPageFunction : public AsyncExtensionFunction {
30 public: 31 public:
31 DECLARE_EXTENSION_FUNCTION_NAME("runtime.getBackgroundPage"); 32 DECLARE_EXTENSION_FUNCTION_NAME("runtime.getBackgroundPage");
32 33
33 protected: 34 protected:
34 virtual ~RuntimeGetBackgroundPageFunction() {} 35 virtual ~RuntimeGetBackgroundPageFunction() {}
35 virtual bool RunImpl() OVERRIDE; 36 virtual bool RunImpl() OVERRIDE;
36 37
37 private: 38 private:
38 void OnPageLoaded(ExtensionHost*); 39 void OnPageLoaded(ExtensionHost*);
39 }; 40 };
40 41
41 } // namespace extensions 42 } // namespace extensions
42 43
43 #endif // CHROME_BROWSER_EXTENSIONS_API_RUNTIME_RUNTIME_API_H_ 44 #endif // CHROME_BROWSER_EXTENSIONS_API_RUNTIME_RUNTIME_API_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/runtime/runtime_api.cc » ('j') | chrome/browser/extensions/extension_prefs.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698