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