[email protected] | 8809f144 | 2012-01-20 21:21:47 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | 36fb2c7c | 2011-04-04 15:49:08 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
[email protected] | a6394ae | 2012-07-16 20:58:43 | [diff] [blame] | 5 | #ifndef CHROME_BROWSER_EXTENSIONS_TAB_HELPER_H_ |
| 6 | #define CHROME_BROWSER_EXTENSIONS_TAB_HELPER_H_ |
[email protected] | 36fb2c7c | 2011-04-04 15:49:08 | [diff] [blame] | 7 | |
[email protected] | 4b64d71 | 2013-01-17 17:53:17 | [diff] [blame] | 8 | #include <map> |
[email protected] | a340bb4 | 2014-01-09 07:33:20 | [diff] [blame] | 9 | #include <set> |
[email protected] | 4b64d71 | 2013-01-17 17:53:17 | [diff] [blame] | 10 | #include <string> |
[email protected] | a714e46 | 2013-01-26 06:33:10 | [diff] [blame] | 11 | #include <vector> |
| 12 | |
[email protected] | 28a69d3 | 2012-05-30 07:58:18 | [diff] [blame] | 13 | #include "base/memory/ref_counted.h" |
[email protected] | 3d6d67652 | 2013-10-14 20:44:55 | [diff] [blame] | 14 | #include "base/memory/scoped_ptr.h" |
[email protected] | 82a4373 | 2011-10-07 16:09:11 | [diff] [blame] | 15 | #include "base/memory/weak_ptr.h" |
[email protected] | a83b840 | 2012-05-17 06:56:44 | [diff] [blame] | 16 | #include "base/observer_list.h" |
[email protected] | 78ce302 | 2012-09-24 01:48:48 | [diff] [blame] | 17 | #include "chrome/browser/extensions/active_tab_permission_granter.h" |
[email protected] | 93f5046 | 2013-05-10 04:40:40 | [diff] [blame] | 18 | #include "chrome/common/web_application_info.h" |
[email protected] | 619f8618 | 2012-07-03 21:30:18 | [diff] [blame] | 19 | #include "content/public/browser/notification_observer.h" |
| 20 | #include "content/public/browser/notification_registrar.h" |
[email protected] | d8c66043 | 2011-12-22 20:51:25 | [diff] [blame] | 21 | #include "content/public/browser/web_contents_observer.h" |
[email protected] | 46b3c98 | 2012-10-09 18:38:30 | [diff] [blame] | 22 | #include "content/public/browser/web_contents_user_data.h" |
[email protected] | 0b9de03 | 2014-03-15 05:47:01 | [diff] [blame] | 23 | #include "extensions/browser/extension_function_dispatcher.h" |
[email protected] | 88b50b6 | 2013-09-01 23:05:06 | [diff] [blame] | 24 | #include "extensions/common/stack_frame.h" |
[email protected] | 36fb2c7c | 2011-04-04 15:49:08 | [diff] [blame] | 25 | #include "third_party/skia/include/core/SkBitmap.h" |
| 26 | |
[email protected] | 89869790 | 2013-12-18 03:25:46 | [diff] [blame] | 27 | class FaviconDownloader; |
| 28 | |
[email protected] | 8286f51a | 2011-05-31 17:39:13 | [diff] [blame] | 29 | namespace content { |
| 30 | struct LoadCommittedDetails; |
| 31 | } |
| 32 | |
[email protected] | 75b91fd | 2013-02-12 22:14:25 | [diff] [blame] | 33 | namespace gfx { |
| 34 | class Image; |
| 35 | } |
| 36 | |
[email protected] | a83b840 | 2012-05-17 06:56:44 | [diff] [blame] | 37 | namespace extensions { |
[email protected] | 33c8789 | 2014-03-25 06:28:15 | [diff] [blame] | 38 | class BookmarkAppHelper; |
[email protected] | 1c321ee5 | 2012-05-21 03:02:34 | [diff] [blame] | 39 | class Extension; |
[email protected] | 4a98816 | 2012-05-27 05:30:01 | [diff] [blame] | 40 | class LocationBarController; |
[email protected] | 09ae70d4 | 2012-11-07 00:42:09 | [diff] [blame] | 41 | class ScriptExecutor; |
[email protected] | 3d6d67652 | 2013-10-14 20:44:55 | [diff] [blame] | 42 | class WebstoreInlineInstallerFactory; |
[email protected] | a83b840 | 2012-05-17 06:56:44 | [diff] [blame] | 43 | |
[email protected] | 74e5140 | 2011-04-06 14:17:59 | [diff] [blame] | 44 | // Per-tab extension helper. Also handles non-extension apps. |
[email protected] | a6394ae | 2012-07-16 20:58:43 | [diff] [blame] | 45 | class TabHelper : public content::WebContentsObserver, |
[email protected] | 1a043689 | 2014-04-01 00:38:25 | [diff] [blame^] | 46 | public extensions::ExtensionFunctionDispatcher::Delegate, |
[email protected] | a6394ae | 2012-07-16 20:58:43 | [diff] [blame] | 47 | public base::SupportsWeakPtr<TabHelper>, |
[email protected] | 7381d9f | 2012-09-12 20:26:22 | [diff] [blame] | 48 | public content::NotificationObserver, |
[email protected] | 46b3c98 | 2012-10-09 18:38:30 | [diff] [blame] | 49 | public content::WebContentsUserData<TabHelper> { |
[email protected] | 36fb2c7c | 2011-04-04 15:49:08 | [diff] [blame] | 50 | public: |
[email protected] | 619f8618 | 2012-07-03 21:30:18 | [diff] [blame] | 51 | // Different types of action when web app info is available. |
| 52 | // OnDidGetApplicationInfo uses this to dispatch calls. |
| 53 | enum WebAppAction { |
[email protected] | 488e395 | 2013-11-18 05:29:14 | [diff] [blame] | 54 | NONE, // No action at all. |
| 55 | CREATE_SHORTCUT, // Bring up create application shortcut dialog. |
| 56 | CREATE_HOSTED_APP, // Create and install a hosted app. |
| 57 | UPDATE_SHORTCUT // Update icon for app shortcut. |
[email protected] | 619f8618 | 2012-07-03 21:30:18 | [diff] [blame] | 58 | }; |
| 59 | |
[email protected] | 09ae70d4 | 2012-11-07 00:42:09 | [diff] [blame] | 60 | // Observer base class for classes that need to be notified when content |
| 61 | // scripts and/or tabs.executeScript calls run on a page. |
| 62 | class ScriptExecutionObserver { |
[email protected] | d5b528c | 2012-09-27 16:30:20 | [diff] [blame] | 63 | public: |
| 64 | // Map of extensions IDs to the executing script paths. |
| 65 | typedef std::map<std::string, std::set<std::string> > ExecutingScriptsMap; |
| 66 | |
| 67 | // Automatically observes and unobserves |tab_helper| on construction |
| 68 | // and destruction. |tab_helper| must outlive |this|. |
[email protected] | 09ae70d4 | 2012-11-07 00:42:09 | [diff] [blame] | 69 | explicit ScriptExecutionObserver(TabHelper* tab_helper); |
| 70 | ScriptExecutionObserver(); |
[email protected] | d5b528c | 2012-09-27 16:30:20 | [diff] [blame] | 71 | |
[email protected] | 09ae70d4 | 2012-11-07 00:42:09 | [diff] [blame] | 72 | // Called when script(s) have executed on a page. |
| 73 | // |
| 74 | // |executing_scripts_map| contains all extensions that are executing |
| 75 | // scripts, mapped to the paths for those scripts. This may be an empty set |
| 76 | // if the script has no path associated with it (e.g. in the case of |
| 77 | // tabs.executeScript). |
| 78 | virtual void OnScriptsExecuted( |
[email protected] | d5b528c | 2012-09-27 16:30:20 | [diff] [blame] | 79 | const content::WebContents* web_contents, |
| 80 | const ExecutingScriptsMap& executing_scripts_map, |
| 81 | int32 on_page_id, |
| 82 | const GURL& on_url) = 0; |
| 83 | |
| 84 | protected: |
[email protected] | 09ae70d4 | 2012-11-07 00:42:09 | [diff] [blame] | 85 | virtual ~ScriptExecutionObserver(); |
[email protected] | d5b528c | 2012-09-27 16:30:20 | [diff] [blame] | 86 | |
[email protected] | d5b528c | 2012-09-27 16:30:20 | [diff] [blame] | 87 | TabHelper* tab_helper_; |
| 88 | }; |
| 89 | |
[email protected] | a6394ae | 2012-07-16 20:58:43 | [diff] [blame] | 90 | virtual ~TabHelper(); |
[email protected] | 36fb2c7c | 2011-04-04 15:49:08 | [diff] [blame] | 91 | |
[email protected] | 09ae70d4 | 2012-11-07 00:42:09 | [diff] [blame] | 92 | void AddScriptExecutionObserver(ScriptExecutionObserver* observer) { |
| 93 | script_execution_observers_.AddObserver(observer); |
[email protected] | d5b528c | 2012-09-27 16:30:20 | [diff] [blame] | 94 | } |
| 95 | |
[email protected] | 09ae70d4 | 2012-11-07 00:42:09 | [diff] [blame] | 96 | void RemoveScriptExecutionObserver(ScriptExecutionObserver* observer) { |
| 97 | script_execution_observers_.RemoveObserver(observer); |
[email protected] | d5b528c | 2012-09-27 16:30:20 | [diff] [blame] | 98 | } |
| 99 | |
[email protected] | 619f8618 | 2012-07-03 21:30:18 | [diff] [blame] | 100 | void CreateApplicationShortcuts(); |
[email protected] | 488e395 | 2013-11-18 05:29:14 | [diff] [blame] | 101 | void CreateHostedAppFromWebContents(); |
[email protected] | 619f8618 | 2012-07-03 21:30:18 | [diff] [blame] | 102 | bool CanCreateApplicationShortcuts() const; |
[email protected] | 1739e57d | 2011-11-30 21:18:25 | [diff] [blame] | 103 | |
[email protected] | 619f8618 | 2012-07-03 21:30:18 | [diff] [blame] | 104 | void set_pending_web_app_action(WebAppAction action) { |
| 105 | pending_web_app_action_ = action; |
| 106 | } |
[email protected] | 553602e1 | 2011-04-05 17:01:18 | [diff] [blame] | 107 | |
[email protected] | 36fb2c7c | 2011-04-04 15:49:08 | [diff] [blame] | 108 | // App extensions ------------------------------------------------------------ |
| 109 | |
| 110 | // Sets the extension denoting this as an app. If |extension| is non-null this |
[email protected] | 0932b30c | 2012-04-17 13:25:10 | [diff] [blame] | 111 | // tab becomes an app-tab. WebContents does not listen for unload events for |
| 112 | // the extension. It's up to consumers of WebContents to do that. |
[email protected] | 36fb2c7c | 2011-04-04 15:49:08 | [diff] [blame] | 113 | // |
| 114 | // NOTE: this should only be manipulated before the tab is added to a browser. |
| 115 | // TODO(sky): resolve if this is the right way to identify an app tab. If it |
| 116 | // is, than this should be passed in the constructor. |
[email protected] | a6394ae | 2012-07-16 20:58:43 | [diff] [blame] | 117 | void SetExtensionApp(const Extension* extension); |
[email protected] | 36fb2c7c | 2011-04-04 15:49:08 | [diff] [blame] | 118 | |
| 119 | // Convenience for setting the app extension by id. This does nothing if |
| 120 | // |extension_app_id| is empty, or an extension can't be found given the |
| 121 | // specified id. |
| 122 | void SetExtensionAppById(const std::string& extension_app_id); |
| 123 | |
[email protected] | dd290d3 | 2012-03-06 02:47:51 | [diff] [blame] | 124 | // Set just the app icon, used by panels created by an extension. |
| 125 | void SetExtensionAppIconById(const std::string& extension_app_id); |
| 126 | |
[email protected] | a6394ae | 2012-07-16 20:58:43 | [diff] [blame] | 127 | const Extension* extension_app() const { return extension_app_; } |
[email protected] | 36fb2c7c | 2011-04-04 15:49:08 | [diff] [blame] | 128 | bool is_app() const { return extension_app_ != NULL; } |
[email protected] | 553602e1 | 2011-04-05 17:01:18 | [diff] [blame] | 129 | const WebApplicationInfo& web_app_info() const { |
| 130 | return web_app_info_; |
| 131 | } |
[email protected] | 36fb2c7c | 2011-04-04 15:49:08 | [diff] [blame] | 132 | |
[email protected] | 0932b30c | 2012-04-17 13:25:10 | [diff] [blame] | 133 | // If an app extension has been explicitly set for this WebContents its icon |
[email protected] | 36fb2c7c | 2011-04-04 15:49:08 | [diff] [blame] | 134 | // is returned. |
| 135 | // |
| 136 | // NOTE: the returned icon is larger than 16x16 (its size is |
[email protected] | 1d5e58b | 2013-01-31 08:41:40 | [diff] [blame] | 137 | // extension_misc::EXTENSION_ICON_SMALLISH). |
[email protected] | 36fb2c7c | 2011-04-04 15:49:08 | [diff] [blame] | 138 | SkBitmap* GetExtensionAppIcon(); |
| 139 | |
[email protected] | ea049a0 | 2011-12-25 21:37:09 | [diff] [blame] | 140 | content::WebContents* web_contents() const { |
| 141 | return content::WebContentsObserver::web_contents(); |
[email protected] | 36fb2c7c | 2011-04-04 15:49:08 | [diff] [blame] | 142 | } |
| 143 | |
[email protected] | a6394ae | 2012-07-16 20:58:43 | [diff] [blame] | 144 | ScriptExecutor* script_executor() { |
[email protected] | 09ae70d4 | 2012-11-07 00:42:09 | [diff] [blame] | 145 | return script_executor_.get(); |
[email protected] | af78a80 | 2012-07-10 23:47:02 | [diff] [blame] | 146 | } |
[email protected] | a83b840 | 2012-05-17 06:56:44 | [diff] [blame] | 147 | |
[email protected] | a6394ae | 2012-07-16 20:58:43 | [diff] [blame] | 148 | LocationBarController* location_bar_controller() { |
[email protected] | af78a80 | 2012-07-10 23:47:02 | [diff] [blame] | 149 | return location_bar_controller_.get(); |
| 150 | } |
[email protected] | a83b840 | 2012-05-17 06:56:44 | [diff] [blame] | 151 | |
[email protected] | 78ce302 | 2012-09-24 01:48:48 | [diff] [blame] | 152 | ActiveTabPermissionGranter* active_tab_permission_granter() { |
| 153 | return active_tab_permission_granter_.get(); |
[email protected] | fc5e65d6b | 2012-06-13 00:22:57 | [diff] [blame] | 154 | } |
| 155 | |
[email protected] | 0932b30c | 2012-04-17 13:25:10 | [diff] [blame] | 156 | // Sets a non-extension app icon associated with WebContents and fires an |
[email protected] | d908348 | 2012-01-06 00:38:46 | [diff] [blame] | 157 | // INVALIDATE_TYPE_TITLE navigation state change to trigger repaint of title. |
[email protected] | 74e5140 | 2011-04-06 14:17:59 | [diff] [blame] | 158 | void SetAppIcon(const SkBitmap& app_icon); |
| 159 | |
[email protected] | 3d6d67652 | 2013-10-14 20:44:55 | [diff] [blame] | 160 | // Sets the factory used to create inline webstore item installers. |
| 161 | // Used for testing. Takes ownership of the factory instance. |
| 162 | void SetWebstoreInlineInstallerFactoryForTests( |
| 163 | WebstoreInlineInstallerFactory* factory); |
| 164 | |
[email protected] | 36fb2c7c | 2011-04-04 15:49:08 | [diff] [blame] | 165 | private: |
[email protected] | a78f03c | 2012-09-15 05:08:19 | [diff] [blame] | 166 | explicit TabHelper(content::WebContents* web_contents); |
[email protected] | 46b3c98 | 2012-10-09 18:38:30 | [diff] [blame] | 167 | friend class content::WebContentsUserData<TabHelper>; |
[email protected] | a78f03c | 2012-09-15 05:08:19 | [diff] [blame] | 168 | |
[email protected] | 33c8789 | 2014-03-25 06:28:15 | [diff] [blame] | 169 | // Displays UI for completion of creating a bookmark hosted app. |
| 170 | void FinishCreateBookmarkApp(const extensions::Extension* extension, |
| 171 | const WebApplicationInfo& web_app_info); |
[email protected] | 89869790 | 2013-12-18 03:25:46 | [diff] [blame] | 172 | |
[email protected] | d8c66043 | 2011-12-22 20:51:25 | [diff] [blame] | 173 | // content::WebContentsObserver overrides. |
[email protected] | fc5e65d6b | 2012-06-13 00:22:57 | [diff] [blame] | 174 | virtual void RenderViewCreated( |
| 175 | content::RenderViewHost* render_view_host) OVERRIDE; |
[email protected] | a6e16aec | 2011-11-11 18:53:04 | [diff] [blame] | 176 | virtual void DidNavigateMainFrame( |
[email protected] | 8286f51a | 2011-05-31 17:39:13 | [diff] [blame] | 177 | const content::LoadCommittedDetails& details, |
[email protected] | 6766b17 | 2011-11-21 18:29:36 | [diff] [blame] | 178 | const content::FrameNavigateParams& params) OVERRIDE; |
[email protected] | 8915f34 | 2011-08-29 22:14:37 | [diff] [blame] | 179 | virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
[email protected] | 7381d9f | 2012-09-12 20:26:22 | [diff] [blame] | 180 | virtual void DidCloneToNewWebContents( |
| 181 | content::WebContents* old_web_contents, |
| 182 | content::WebContents* new_web_contents) OVERRIDE; |
[email protected] | 553602e1 | 2011-04-05 17:01:18 | [diff] [blame] | 183 | |
[email protected] | 1a043689 | 2014-04-01 00:38:25 | [diff] [blame^] | 184 | // extensions::ExtensionFunctionDispatcher::Delegate overrides. |
[email protected] | 44f4b13 | 2012-07-17 20:36:57 | [diff] [blame] | 185 | virtual extensions::WindowController* GetExtensionWindowController() |
[email protected] | b51f3562 | 2012-05-05 22:01:43 | [diff] [blame] | 186 | const OVERRIDE; |
[email protected] | ea049a0 | 2011-12-25 21:37:09 | [diff] [blame] | 187 | virtual content::WebContents* GetAssociatedWebContents() const OVERRIDE; |
[email protected] | c5dbef0 | 2011-05-13 05:06:09 | [diff] [blame] | 188 | |
[email protected] | 553602e1 | 2011-04-05 17:01:18 | [diff] [blame] | 189 | // Message handlers. |
| 190 | void OnDidGetApplicationInfo(int32 page_id, const WebApplicationInfo& info); |
[email protected] | a221ef09 | 2011-09-07 01:34:10 | [diff] [blame] | 191 | void OnInlineWebstoreInstall(int install_id, |
[email protected] | 7b92104 | 2012-02-11 01:41:27 | [diff] [blame] | 192 | int return_route_id, |
[email protected] | a221ef09 | 2011-09-07 01:34:10 | [diff] [blame] | 193 | const std::string& webstore_item_id, |
[email protected] | c80fe5f | 2014-03-26 04:36:30 | [diff] [blame] | 194 | const GURL& requestor_url, |
| 195 | int listeners_mask); |
[email protected] | f2fe87c | 2012-04-24 17:53:49 | [diff] [blame] | 196 | void OnGetAppInstallState(const GURL& requestor_url, |
| 197 | int return_route_id, |
| 198 | int callback_id); |
[email protected] | c5dbef0 | 2011-05-13 05:06:09 | [diff] [blame] | 199 | void OnRequest(const ExtensionHostMsg_Request_Params& params); |
[email protected] | d5b528c | 2012-09-27 16:30:20 | [diff] [blame] | 200 | void OnContentScriptsExecuting( |
[email protected] | 09ae70d4 | 2012-11-07 00:42:09 | [diff] [blame] | 201 | const ScriptExecutionObserver::ExecutingScriptsMap& extension_ids, |
[email protected] | d5b528c | 2012-09-27 16:30:20 | [diff] [blame] | 202 | int32 page_id, |
| 203 | const GURL& on_url); |
[email protected] | a714e46 | 2013-01-26 06:33:10 | [diff] [blame] | 204 | void OnWatchedPageChange(const std::vector<std::string>& css_selectors); |
[email protected] | 88b50b6 | 2013-09-01 23:05:06 | [diff] [blame] | 205 | void OnDetailedConsoleMessageAdded(const base::string16& message, |
| 206 | const base::string16& source, |
| 207 | const StackTrace& stack_trace, |
| 208 | int32 severity_level); |
[email protected] | 36fb2c7c | 2011-04-04 15:49:08 | [diff] [blame] | 209 | |
| 210 | // App extensions related methods: |
| 211 | |
[email protected] | 75b91fd | 2013-02-12 22:14:25 | [diff] [blame] | 212 | // Resets app_icon_ and if |extension| is non-null uses ImageLoader to load |
| 213 | // the extension's image asynchronously. |
[email protected] | a6394ae | 2012-07-16 20:58:43 | [diff] [blame] | 214 | void UpdateExtensionAppIcon(const Extension* extension); |
[email protected] | 36fb2c7c | 2011-04-04 15:49:08 | [diff] [blame] | 215 | |
[email protected] | 7069ed8 | 2013-01-26 01:39:53 | [diff] [blame] | 216 | const Extension* GetExtension(const std::string& extension_app_id); |
[email protected] | dd290d3 | 2012-03-06 02:47:51 | [diff] [blame] | 217 | |
[email protected] | 7069ed8 | 2013-01-26 01:39:53 | [diff] [blame] | 218 | void OnImageLoaded(const gfx::Image& image); |
[email protected] | 8915f34 | 2011-08-29 22:14:37 | [diff] [blame] | 219 | |
[email protected] | 734bcec | 2012-10-08 20:29:05 | [diff] [blame] | 220 | // WebstoreStandaloneInstaller::Callback. |
[email protected] | d2a639e | 2012-09-17 07:41:21 | [diff] [blame] | 221 | virtual void OnInlineInstallComplete(int install_id, |
| 222 | int return_route_id, |
| 223 | bool success, |
| 224 | const std::string& error); |
[email protected] | 36fb2c7c | 2011-04-04 15:49:08 | [diff] [blame] | 225 | |
[email protected] | 619f8618 | 2012-07-03 21:30:18 | [diff] [blame] | 226 | // content::NotificationObserver. |
| 227 | virtual void Observe(int type, |
| 228 | const content::NotificationSource& source, |
| 229 | const content::NotificationDetails& details) OVERRIDE; |
| 230 | |
| 231 | // Requests application info for the specified page. This is an asynchronous |
| 232 | // request. The delegate is notified by way of OnDidGetApplicationInfo when |
| 233 | // the data is available. |
| 234 | void GetApplicationInfo(int32 page_id); |
| 235 | |
[email protected] | 2fc1cad1 | 2013-05-21 00:41:39 | [diff] [blame] | 236 | // Sends our tab ID to |render_view_host|. |
| 237 | void SetTabId(content::RenderViewHost* render_view_host); |
| 238 | |
[email protected] | 36fb2c7c | 2011-04-04 15:49:08 | [diff] [blame] | 239 | // Data for app extensions --------------------------------------------------- |
| 240 | |
[email protected] | d5b528c | 2012-09-27 16:30:20 | [diff] [blame] | 241 | // Our content script observers. Declare at top so that it will outlive all |
| 242 | // other members, since they might add themselves as observers. |
[email protected] | 09ae70d4 | 2012-11-07 00:42:09 | [diff] [blame] | 243 | ObserverList<ScriptExecutionObserver> script_execution_observers_; |
[email protected] | a83b840 | 2012-05-17 06:56:44 | [diff] [blame] | 244 | |
[email protected] | 36fb2c7c | 2011-04-04 15:49:08 | [diff] [blame] | 245 | // If non-null this tab is an app tab and this is the extension the tab was |
| 246 | // created for. |
[email protected] | a6394ae | 2012-07-16 20:58:43 | [diff] [blame] | 247 | const Extension* extension_app_; |
[email protected] | 36fb2c7c | 2011-04-04 15:49:08 | [diff] [blame] | 248 | |
[email protected] | 74e5140 | 2011-04-06 14:17:59 | [diff] [blame] | 249 | // Icon for extension_app_ (if non-null) or a manually-set icon for |
| 250 | // non-extension apps. |
[email protected] | 36fb2c7c | 2011-04-04 15:49:08 | [diff] [blame] | 251 | SkBitmap extension_app_icon_; |
| 252 | |
[email protected] | c5dbef0 | 2011-05-13 05:06:09 | [diff] [blame] | 253 | // Process any extension messages coming from the tab. |
[email protected] | 1a043689 | 2014-04-01 00:38:25 | [diff] [blame^] | 254 | extensions::ExtensionFunctionDispatcher extension_function_dispatcher_; |
[email protected] | c5dbef0 | 2011-05-13 05:06:09 | [diff] [blame] | 255 | |
[email protected] | 553602e1 | 2011-04-05 17:01:18 | [diff] [blame] | 256 | // Cached web app info data. |
| 257 | WebApplicationInfo web_app_info_; |
| 258 | |
[email protected] | 619f8618 | 2012-07-03 21:30:18 | [diff] [blame] | 259 | // Which deferred action to perform when OnDidGetApplicationInfo is notified |
| 260 | // from a WebContents. |
| 261 | WebAppAction pending_web_app_action_; |
| 262 | |
| 263 | content::NotificationRegistrar registrar_; |
| 264 | |
[email protected] | 09ae70d4 | 2012-11-07 00:42:09 | [diff] [blame] | 265 | scoped_ptr<ScriptExecutor> script_executor_; |
[email protected] | af78a80 | 2012-07-10 23:47:02 | [diff] [blame] | 266 | |
[email protected] | a6394ae | 2012-07-16 20:58:43 | [diff] [blame] | 267 | scoped_ptr<LocationBarController> location_bar_controller_; |
[email protected] | a83b840 | 2012-05-17 06:56:44 | [diff] [blame] | 268 | |
[email protected] | 78ce302 | 2012-09-24 01:48:48 | [diff] [blame] | 269 | scoped_ptr<ActiveTabPermissionGranter> active_tab_permission_granter_; |
[email protected] | fc5e65d6b | 2012-06-13 00:22:57 | [diff] [blame] | 270 | |
[email protected] | 33c8789 | 2014-03-25 06:28:15 | [diff] [blame] | 271 | scoped_ptr<BookmarkAppHelper> bookmark_app_helper_; |
[email protected] | 89869790 | 2013-12-18 03:25:46 | [diff] [blame] | 272 | |
[email protected] | 4b64d71 | 2013-01-17 17:53:17 | [diff] [blame] | 273 | Profile* profile_; |
| 274 | |
[email protected] | 7069ed8 | 2013-01-26 01:39:53 | [diff] [blame] | 275 | // Vend weak pointers that can be invalidated to stop in-progress loads. |
| 276 | base::WeakPtrFactory<TabHelper> image_loader_ptr_factory_; |
| 277 | |
[email protected] | 3d6d67652 | 2013-10-14 20:44:55 | [diff] [blame] | 278 | // Creates WebstoreInlineInstaller instances for inline install triggers. |
| 279 | scoped_ptr<WebstoreInlineInstallerFactory> webstore_inline_installer_factory_; |
| 280 | |
[email protected] | a6394ae | 2012-07-16 20:58:43 | [diff] [blame] | 281 | DISALLOW_COPY_AND_ASSIGN(TabHelper); |
[email protected] | 36fb2c7c | 2011-04-04 15:49:08 | [diff] [blame] | 282 | }; |
| 283 | |
[email protected] | a6394ae | 2012-07-16 20:58:43 | [diff] [blame] | 284 | } // namespace extensions |
| 285 | |
| 286 | #endif // CHROME_BROWSER_EXTENSIONS_TAB_HELPER_H_ |