OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 EXTENSIONS_BROWSER_API_RUNTIME_RUNTIME_API_DELEGATE_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_RUNTIME_RUNTIME_API_DELEGATE_H_ |
6 #define EXTENSIONS_BROWSER_API_RUNTIME_RUNTIME_API_DELEGATE_H_ | 6 #define EXTENSIONS_BROWSER_API_RUNTIME_RUNTIME_API_DELEGATE_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/version.h" | 9 #include "base/version.h" |
10 | 10 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 // The callback given to RequestUpdateCheck. | 45 // The callback given to RequestUpdateCheck. |
46 typedef base::Callback<void(const UpdateCheckResult&)> UpdateCheckCallback; | 46 typedef base::Callback<void(const UpdateCheckResult&)> UpdateCheckCallback; |
47 | 47 |
48 // Registers an UpdateObserver on behalf of the runtime API. | 48 // Registers an UpdateObserver on behalf of the runtime API. |
49 virtual void AddUpdateObserver(UpdateObserver* observer) = 0; | 49 virtual void AddUpdateObserver(UpdateObserver* observer) = 0; |
50 | 50 |
51 // Unregisters an UpdateObserver on behalf of the runtime API. | 51 // Unregisters an UpdateObserver on behalf of the runtime API. |
52 virtual void RemoveUpdateObserver(UpdateObserver* observer) = 0; | 52 virtual void RemoveUpdateObserver(UpdateObserver* observer) = 0; |
53 | 53 |
54 // Determines an extension's previously installed version if applicable. | |
55 virtual base::Version GetPreviousExtensionVersion( | |
56 const Extension* extension) = 0; | |
57 | |
58 // Reloads an extension. | 54 // Reloads an extension. |
59 virtual void ReloadExtension(const std::string& extension_id) = 0; | 55 virtual void ReloadExtension(const std::string& extension_id) = 0; |
60 | 56 |
61 // Requests an extensions update update check. Returns |false| if updates | 57 // Requests an extensions update update check. Returns |false| if updates |
62 // are disabled. Otherwise |callback| is called with the result of the | 58 // are disabled. Otherwise |callback| is called with the result of the |
63 // update check. | 59 // update check. |
64 virtual bool CheckForUpdates(const std::string& extension_id, | 60 virtual bool CheckForUpdates(const std::string& extension_id, |
65 const UpdateCheckCallback& callback) = 0; | 61 const UpdateCheckCallback& callback) = 0; |
66 | 62 |
67 // Navigates the browser to a URL on behalf of the runtime API. | 63 // Navigates the browser to a URL on behalf of the runtime API. |
(...skipping 10 matching lines...) Expand all Loading... |
78 // Open |extension|'s options page, if it has one. Returns true if an | 74 // Open |extension|'s options page, if it has one. Returns true if an |
79 // options page was opened, false otherwise. See the docs of the | 75 // options page was opened, false otherwise. See the docs of the |
80 // chrome.runtime.openOptionsPage function for the gritty details. | 76 // chrome.runtime.openOptionsPage function for the gritty details. |
81 virtual bool OpenOptionsPage(const Extension* extension, | 77 virtual bool OpenOptionsPage(const Extension* extension, |
82 content::BrowserContext* browser_context); | 78 content::BrowserContext* browser_context); |
83 }; | 79 }; |
84 | 80 |
85 } // namespace extensions | 81 } // namespace extensions |
86 | 82 |
87 #endif // EXTENSIONS_BROWSER_API_RUNTIME_RUNTIME_API_DELEGATE_H_ | 83 #endif // EXTENSIONS_BROWSER_API_RUNTIME_RUNTIME_API_DELEGATE_H_ |
OLD | NEW |