feat: partially support chrome.tabs.update (#30069)

This commit is contained in:
Jeremy Rose 2021-07-27 13:36:22 -07:00 committed by GitHub
parent cce27a0961
commit ceebae170e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 315 additions and 7 deletions

View file

@ -88,6 +88,25 @@ class TabsGetZoomSettingsFunction : public ExtensionFunction {
DECLARE_EXTENSION_FUNCTION("tabs.getZoomSettings", TABS_GETZOOMSETTINGS)
};
class TabsUpdateFunction : public ExtensionFunction {
public:
TabsUpdateFunction();
protected:
~TabsUpdateFunction() override {}
bool UpdateURL(const std::string& url, int tab_id, std::string* error);
ResponseValue GetResult();
content::WebContents* web_contents_;
private:
ResponseAction Run() override;
void OnExecuteCodeFinished(const std::string& error,
const GURL& on_url,
const base::ListValue& script_result);
DECLARE_EXTENSION_FUNCTION("tabs.update", TABS_UPDATE)
};
} // namespace extensions
#endif // SHELL_BROWSER_EXTENSIONS_API_TABS_TABS_API_H_