OLD | NEW |
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_EXTENSION_ACTION_EXTENSION_ACTION_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_EXTENSION_ACTION_EXTENSION_ACTION_API_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_EXTENSION_ACTION_EXTENSION_ACTION_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_EXTENSION_ACTION_EXTENSION_ACTION_API_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 GetFactoryInstance(); | 83 GetFactoryInstance(); |
84 | 84 |
85 // Add or remove observers. | 85 // Add or remove observers. |
86 void AddObserver(Observer* observer); | 86 void AddObserver(Observer* observer); |
87 void RemoveObserver(Observer* observer); | 87 void RemoveObserver(Observer* observer); |
88 | 88 |
89 void NotifyChange(ExtensionAction* extension_action, | 89 void NotifyChange(ExtensionAction* extension_action, |
90 content::WebContents* web_contents, | 90 content::WebContents* web_contents, |
91 content::BrowserContext* browser_context); | 91 content::BrowserContext* browser_context); |
92 | 92 |
| 93 // Clears the values for all ExtensionActions for the tab associated with the |
| 94 // given |web_contents|. |
| 95 void ClearAllValuesForTab(content::WebContents* web_contents); |
| 96 |
93 private: | 97 private: |
94 friend class BrowserContextKeyedAPIFactory<ExtensionActionAPI>; | 98 friend class BrowserContextKeyedAPIFactory<ExtensionActionAPI>; |
95 | 99 |
96 // The DispatchEvent methods forward events to the |profile|'s event router. | 100 // The DispatchEvent methods forward events to the |profile|'s event router. |
97 static void DispatchEventToExtension(content::BrowserContext* context, | 101 static void DispatchEventToExtension(content::BrowserContext* context, |
98 const std::string& extension_id, | 102 const std::string& extension_id, |
99 const std::string& event_name, | 103 const std::string& event_name, |
100 scoped_ptr<base::ListValue> event_args); | 104 scoped_ptr<base::ListValue> event_args); |
101 | 105 |
102 // Called when either a browser or page action is executed. Figures out which | 106 // Called when either a browser or page action is executed. Figures out which |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 class PageActionGetPopupFunction | 468 class PageActionGetPopupFunction |
465 : public extensions::ExtensionActionGetPopupFunction { | 469 : public extensions::ExtensionActionGetPopupFunction { |
466 public: | 470 public: |
467 DECLARE_EXTENSION_FUNCTION("pageAction.getPopup", PAGEACTION_GETPOPUP) | 471 DECLARE_EXTENSION_FUNCTION("pageAction.getPopup", PAGEACTION_GETPOPUP) |
468 | 472 |
469 protected: | 473 protected: |
470 virtual ~PageActionGetPopupFunction() {} | 474 virtual ~PageActionGetPopupFunction() {} |
471 }; | 475 }; |
472 | 476 |
473 #endif // CHROME_BROWSER_EXTENSIONS_API_EXTENSION_ACTION_EXTENSION_ACTION_API_H
_ | 477 #endif // CHROME_BROWSER_EXTENSIONS_API_EXTENSION_ACTION_EXTENSION_ACTION_API_H
_ |
OLD | NEW |