| 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" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 namespace extensions { | 30 namespace extensions { |
| 31 class Extension; | 31 class Extension; |
| 32 class LocationBarController; | 32 class LocationBarController; |
| 33 class ScriptBadgeController; | 33 class ScriptBadgeController; |
| 34 class ScriptExecutor; | 34 class ScriptExecutor; |
| 35 | 35 |
| 36 // Per-tab extension helper. Also handles non-extension apps. | 36 // Per-tab extension helper. Also handles non-extension apps. |
| 37 class TabHelper : public content::WebContentsObserver, | 37 class TabHelper : public content::WebContentsObserver, |
| 38 public ExtensionFunctionDispatcher::Delegate, | 38 public ExtensionFunctionDispatcher::Delegate, |
| 39 public ImageLoadingTracker::Observer, | 39 public ImageLoadingTracker::Observer, |
| 40 public WebstoreInlineInstaller::Delegate, | |
| 41 public AppNotifyChannelSetup::Delegate, | 40 public AppNotifyChannelSetup::Delegate, |
| 42 public base::SupportsWeakPtr<TabHelper>, | 41 public base::SupportsWeakPtr<TabHelper>, |
| 43 public content::NotificationObserver, | 42 public content::NotificationObserver, |
| 44 public WebContentsUserData<TabHelper> { | 43 public WebContentsUserData<TabHelper> { |
| 45 public: | 44 public: |
| 46 // Different types of action when web app info is available. | 45 // Different types of action when web app info is available. |
| 47 // OnDidGetApplicationInfo uses this to dispatch calls. | 46 // OnDidGetApplicationInfo uses this to dispatch calls. |
| 48 enum WebAppAction { | 47 enum WebAppAction { |
| 49 NONE, // No action at all. | 48 NONE, // No action at all. |
| 50 CREATE_SHORTCUT, // Bring up create application shortcut dialog. | 49 CREATE_SHORTCUT, // Bring up create application shortcut dialog. |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 void UpdateExtensionAppIcon(const Extension* extension); | 155 void UpdateExtensionAppIcon(const Extension* extension); |
| 157 | 156 |
| 158 const Extension* GetExtension( | 157 const Extension* GetExtension( |
| 159 const std::string& extension_app_id); | 158 const std::string& extension_app_id); |
| 160 | 159 |
| 161 // ImageLoadingTracker::Observer. | 160 // ImageLoadingTracker::Observer. |
| 162 virtual void OnImageLoaded(const gfx::Image& image, | 161 virtual void OnImageLoaded(const gfx::Image& image, |
| 163 const std::string& extension_id, | 162 const std::string& extension_id, |
| 164 int index) OVERRIDE; | 163 int index) OVERRIDE; |
| 165 | 164 |
| 166 // WebstoreInlineInstaller::Delegate. | 165 // WebstoreInlineInstaller::Callback. |
| 167 virtual void OnInlineInstallSuccess(int install_id, | 166 virtual void OnInlineInstallComplete(int install_id, |
| 168 int return_route_id) OVERRIDE; | 167 int return_route_id, |
| 169 virtual void OnInlineInstallFailure(int install_id, | 168 bool success, |
| 170 int return_route_id, | 169 const std::string& error); |
| 171 const std::string& error) OVERRIDE; | |
| 172 | 170 |
| 173 // AppNotifyChannelSetup::Delegate. | 171 // AppNotifyChannelSetup::Delegate. |
| 174 virtual void AppNotifyChannelSetupComplete( | 172 virtual void AppNotifyChannelSetupComplete( |
| 175 const std::string& channel_id, | 173 const std::string& channel_id, |
| 176 const std::string& error, | 174 const std::string& error, |
| 177 const AppNotifyChannelSetup* setup) OVERRIDE; | 175 const AppNotifyChannelSetup* setup) OVERRIDE; |
| 178 | 176 |
| 179 // content::NotificationObserver. | 177 // content::NotificationObserver. |
| 180 virtual void Observe(int type, | 178 virtual void Observe(int type, |
| 181 const content::NotificationSource& source, | 179 const content::NotificationSource& source, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 scoped_ptr<LocationBarController> location_bar_controller_; | 218 scoped_ptr<LocationBarController> location_bar_controller_; |
| 221 | 219 |
| 222 scoped_ptr<ActiveTabPermissionManager> active_tab_permission_manager_; | 220 scoped_ptr<ActiveTabPermissionManager> active_tab_permission_manager_; |
| 223 | 221 |
| 224 DISALLOW_COPY_AND_ASSIGN(TabHelper); | 222 DISALLOW_COPY_AND_ASSIGN(TabHelper); |
| 225 }; | 223 }; |
| 226 | 224 |
| 227 } // namespace extensions | 225 } // namespace extensions |
| 228 | 226 |
| 229 #endif // CHROME_BROWSER_EXTENSIONS_TAB_HELPER_H_ | 227 #endif // CHROME_BROWSER_EXTENSIONS_TAB_HELPER_H_ |
| OLD | NEW |