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_TAB_HELPER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_TAB_HELPER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_TAB_HELPER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_TAB_HELPER_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
11 #include "chrome/browser/extensions/active_tab_permission_granter.h" | 11 #include "chrome/browser/extensions/active_tab_permission_granter.h" |
12 #include "chrome/browser/extensions/app_notify_channel_setup.h" | 12 #include "chrome/browser/extensions/app_notify_channel_setup.h" |
13 #include "chrome/browser/extensions/extension_function_dispatcher.h" | 13 #include "chrome/browser/extensions/extension_function_dispatcher.h" |
14 #include "chrome/browser/extensions/image_loading_tracker.h" | 14 #include "chrome/browser/extensions/image_loading_tracker.h" |
15 #include "chrome/common/web_apps.h" | 15 #include "chrome/common/web_apps.h" |
16 #include "content/public/browser/notification_observer.h" | 16 #include "content/public/browser/notification_observer.h" |
17 #include "content/public/browser/notification_registrar.h" | 17 #include "content/public/browser/notification_registrar.h" |
18 #include "content/public/browser/web_contents_observer.h" | 18 #include "content/public/browser/web_contents_observer.h" |
19 #include "content/public/browser/web_contents_user_data.h" | 19 #include "content/public/browser/web_contents_user_data.h" |
20 #include "third_party/skia/include/core/SkBitmap.h" | 20 #include "third_party/skia/include/core/SkBitmap.h" |
21 | 21 |
22 struct WebApplicationInfo; | 22 struct WebApplicationInfo; |
23 | 23 |
24 namespace content { | 24 namespace content { |
25 struct LoadCommittedDetails; | 25 struct LoadCommittedDetails; |
26 } | 26 } |
27 | 27 |
28 namespace extensions { | 28 namespace extensions { |
| 29 class ContentRulesRegistry; |
29 class Extension; | 30 class Extension; |
30 class LocationBarController; | 31 class LocationBarController; |
31 class ScriptBadgeController; | 32 class ScriptBadgeController; |
32 class ScriptBubbleController; | 33 class ScriptBubbleController; |
33 class ScriptExecutor; | 34 class ScriptExecutor; |
34 | 35 |
35 // Per-tab extension helper. Also handles non-extension apps. | 36 // Per-tab extension helper. Also handles non-extension apps. |
36 class TabHelper : public content::WebContentsObserver, | 37 class TabHelper : public content::WebContentsObserver, |
37 public ExtensionFunctionDispatcher::Delegate, | 38 public ExtensionFunctionDispatcher::Delegate, |
38 public ImageLoadingTracker::Observer, | 39 public ImageLoadingTracker::Observer, |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 int return_route_id, | 185 int return_route_id, |
185 int callback_id); | 186 int callback_id); |
186 void OnGetAppInstallState(const GURL& requestor_url, | 187 void OnGetAppInstallState(const GURL& requestor_url, |
187 int return_route_id, | 188 int return_route_id, |
188 int callback_id); | 189 int callback_id); |
189 void OnRequest(const ExtensionHostMsg_Request_Params& params); | 190 void OnRequest(const ExtensionHostMsg_Request_Params& params); |
190 void OnContentScriptsExecuting( | 191 void OnContentScriptsExecuting( |
191 const ScriptExecutionObserver::ExecutingScriptsMap& extension_ids, | 192 const ScriptExecutionObserver::ExecutingScriptsMap& extension_ids, |
192 int32 page_id, | 193 int32 page_id, |
193 const GURL& on_url); | 194 const GURL& on_url); |
| 195 void OnWatchedPageChange(const std::vector<std::string>& css_selectors); |
194 | 196 |
195 // App extensions related methods: | 197 // App extensions related methods: |
196 | 198 |
197 // Resets app_icon_ and if |extension| is non-null creates a new | 199 // Resets app_icon_ and if |extension| is non-null creates a new |
198 // ImageLoadingTracker to load the extension's image. | 200 // ImageLoadingTracker to load the extension's image. |
199 void UpdateExtensionAppIcon(const Extension* extension); | 201 void UpdateExtensionAppIcon(const Extension* extension); |
200 | 202 |
201 const Extension* GetExtension( | 203 const Extension* GetExtension( |
202 const std::string& extension_app_id); | 204 const std::string& extension_app_id); |
203 | 205 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 content::NotificationRegistrar registrar_; | 260 content::NotificationRegistrar registrar_; |
259 | 261 |
260 scoped_ptr<ScriptExecutor> script_executor_; | 262 scoped_ptr<ScriptExecutor> script_executor_; |
261 | 263 |
262 scoped_ptr<LocationBarController> location_bar_controller_; | 264 scoped_ptr<LocationBarController> location_bar_controller_; |
263 | 265 |
264 scoped_ptr<ActiveTabPermissionGranter> active_tab_permission_granter_; | 266 scoped_ptr<ActiveTabPermissionGranter> active_tab_permission_granter_; |
265 | 267 |
266 scoped_ptr<ScriptBubbleController> script_bubble_controller_; | 268 scoped_ptr<ScriptBubbleController> script_bubble_controller_; |
267 | 269 |
| 270 ContentRulesRegistry* content_rules_registry_; |
| 271 |
268 DISALLOW_COPY_AND_ASSIGN(TabHelper); | 272 DISALLOW_COPY_AND_ASSIGN(TabHelper); |
269 }; | 273 }; |
270 | 274 |
271 } // namespace extensions | 275 } // namespace extensions |
272 | 276 |
273 #endif // CHROME_BROWSER_EXTENSIONS_TAB_HELPER_H_ | 277 #endif // CHROME_BROWSER_EXTENSIONS_TAB_HELPER_H_ |
OLD | NEW |