| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_EXTENSION_ACTION_SCRIPT_BADGE_API_H_ | |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_EXTENSION_ACTION_SCRIPT_BADGE_API_H_ | |
| 7 | |
| 8 #include "chrome/browser/extensions/api/extension_action/extension_actions_api.h
" | |
| 9 #include "chrome/browser/extensions/api/profile_keyed_api_factory.h" | |
| 10 #include "chrome/browser/extensions/extension_function.h" | |
| 11 | |
| 12 namespace extensions { | |
| 13 | |
| 14 class ScriptBadgeAPI : public ProfileKeyedAPI { | |
| 15 public: | |
| 16 explicit ScriptBadgeAPI(Profile* profile); | |
| 17 virtual ~ScriptBadgeAPI(); | |
| 18 | |
| 19 // ProfileKeyedAPI implementation. | |
| 20 static ProfileKeyedAPIFactory<ScriptBadgeAPI>* GetFactoryInstance(); | |
| 21 | |
| 22 private: | |
| 23 friend class ProfileKeyedAPIFactory<ScriptBadgeAPI>; | |
| 24 | |
| 25 // ProfileKeyedAPI implementation. | |
| 26 static const char* service_name() { return "ScriptBadgeAPI"; } | |
| 27 | |
| 28 DISALLOW_COPY_AND_ASSIGN(ScriptBadgeAPI); | |
| 29 }; | |
| 30 | |
| 31 // | |
| 32 // scriptBadge.* aliases for supported scriptBadge APIs. | |
| 33 // | |
| 34 | |
| 35 class ScriptBadgeSetPopupFunction : public ExtensionActionSetPopupFunction { | |
| 36 public: | |
| 37 DECLARE_EXTENSION_FUNCTION("scriptBadge.setPopup", SCRIPTBADGE_SETPOPUP) | |
| 38 | |
| 39 protected: | |
| 40 virtual ~ScriptBadgeSetPopupFunction() {} | |
| 41 }; | |
| 42 | |
| 43 class ScriptBadgeGetPopupFunction : public ExtensionActionGetPopupFunction { | |
| 44 public: | |
| 45 DECLARE_EXTENSION_FUNCTION("scriptBadge.getPopup", SCRIPTBADGE_GETPOPUP) | |
| 46 | |
| 47 protected: | |
| 48 virtual ~ScriptBadgeGetPopupFunction() {} | |
| 49 }; | |
| 50 | |
| 51 // scriptBadge.getAttention(tabId) | |
| 52 class ScriptBadgeGetAttentionFunction : public ExtensionActionFunction { | |
| 53 public: | |
| 54 DECLARE_EXTENSION_FUNCTION("scriptBadge.getAttention", | |
| 55 SCRIPTBADGE_GETATTENTION) | |
| 56 | |
| 57 virtual bool RunExtensionAction() OVERRIDE; | |
| 58 | |
| 59 protected: | |
| 60 virtual ~ScriptBadgeGetAttentionFunction(); | |
| 61 }; | |
| 62 | |
| 63 } // namespace extensions | |
| 64 | |
| 65 #endif // CHROME_BROWSER_EXTENSIONS_API_EXTENSION_ACTION_SCRIPT_BADGE_API_H_ | |
| OLD | NEW |