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/observer_list.h" | 10 #include "base/observer_list.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 76 |
77 // Executes the action of the given |extension| on the |browser|'s active | 77 // Executes the action of the given |extension| on the |browser|'s active |
78 // web contents. If |grant_tab_permissions| is true, this will also grant | 78 // web contents. If |grant_tab_permissions| is true, this will also grant |
79 // activeTab to the extension (so this should only be done if this is through | 79 // activeTab to the extension (so this should only be done if this is through |
80 // a direct user action). Returns the action that should be taken. | 80 // a direct user action). Returns the action that should be taken. |
81 ExtensionAction::ShowAction ExecuteExtensionAction( | 81 ExtensionAction::ShowAction ExecuteExtensionAction( |
82 const Extension* extension, | 82 const Extension* extension, |
83 Browser* browser, | 83 Browser* browser, |
84 bool grant_active_tab_permissions); | 84 bool grant_active_tab_permissions); |
85 | 85 |
| 86 // Opens the popup for the given |extension| in the given |browser|'s window. |
| 87 // If |grant_active_tab_permissions| is true, this grants the extension |
| 88 // activeTab (so this should only be done if this is through a direct user |
| 89 // action). |
| 90 bool ShowExtensionActionPopup(const Extension* extension, |
| 91 Browser* browser, |
| 92 bool grant_active_tab_permissions); |
| 93 |
86 // Notifies that there has been a change in the given |extension_action|. | 94 // Notifies that there has been a change in the given |extension_action|. |
87 void NotifyChange(ExtensionAction* extension_action, | 95 void NotifyChange(ExtensionAction* extension_action, |
88 content::WebContents* web_contents, | 96 content::WebContents* web_contents, |
89 content::BrowserContext* browser_context); | 97 content::BrowserContext* browser_context); |
90 | 98 |
91 // Clears the values for all ExtensionActions for the tab associated with the | 99 // Clears the values for all ExtensionActions for the tab associated with the |
92 // given |web_contents| (and signals that page actions changed). | 100 // given |web_contents| (and signals that page actions changed). |
93 void ClearAllValuesForTab(content::WebContents* web_contents); | 101 void ClearAllValuesForTab(content::WebContents* web_contents); |
94 | 102 |
95 // Notifies that the current set of page actions for |web_contents| has | 103 // Notifies that the current set of page actions for |web_contents| has |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 class PageActionGetPopupFunction | 437 class PageActionGetPopupFunction |
430 : public extensions::ExtensionActionGetPopupFunction { | 438 : public extensions::ExtensionActionGetPopupFunction { |
431 public: | 439 public: |
432 DECLARE_EXTENSION_FUNCTION("pageAction.getPopup", PAGEACTION_GETPOPUP) | 440 DECLARE_EXTENSION_FUNCTION("pageAction.getPopup", PAGEACTION_GETPOPUP) |
433 | 441 |
434 protected: | 442 protected: |
435 virtual ~PageActionGetPopupFunction() {} | 443 virtual ~PageActionGetPopupFunction() {} |
436 }; | 444 }; |
437 | 445 |
438 #endif // CHROME_BROWSER_EXTENSIONS_API_EXTENSION_ACTION_EXTENSION_ACTION_API_H
_ | 446 #endif // CHROME_BROWSER_EXTENSIONS_API_EXTENSION_ACTION_EXTENSION_ACTION_API_H
_ |
OLD | NEW |