OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_EXTENSION_TAB_HELPER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_TAB_HELPER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_TAB_HELPER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_TAB_HELPER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "content/browser/tab_contents/tab_contents_observer.h" | 9 #include "content/browser/tab_contents/tab_contents_observer.h" |
10 #include "chrome/browser/extensions/extension_function_dispatcher.h" | 10 #include "chrome/browser/extensions/extension_function_dispatcher.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 90 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
91 | 91 |
92 // ExtensionFunctionDispatcher::Delegate overrides. | 92 // ExtensionFunctionDispatcher::Delegate overrides. |
93 virtual Browser* GetBrowser() OVERRIDE; | 93 virtual Browser* GetBrowser() OVERRIDE; |
94 virtual gfx::NativeView GetNativeViewOfHost() OVERRIDE; | 94 virtual gfx::NativeView GetNativeViewOfHost() OVERRIDE; |
95 virtual TabContents* GetAssociatedTabContents() const OVERRIDE; | 95 virtual TabContents* GetAssociatedTabContents() const OVERRIDE; |
96 | 96 |
97 // Message handlers. | 97 // Message handlers. |
98 void OnDidGetApplicationInfo(int32 page_id, const WebApplicationInfo& info); | 98 void OnDidGetApplicationInfo(int32 page_id, const WebApplicationInfo& info); |
99 void OnInstallApplication(const WebApplicationInfo& info); | 99 void OnInstallApplication(const WebApplicationInfo& info); |
100 void OnInlineWebstoreInstall(const std::string& webstore_item_id); | 100 void OnInlineWebstoreInstall(int install_id, |
| 101 const std::string& webstore_item_id, |
| 102 const GURL& requestor_url); |
101 void OnRequest(const ExtensionHostMsg_Request_Params& params); | 103 void OnRequest(const ExtensionHostMsg_Request_Params& params); |
102 | 104 |
103 // App extensions related methods: | 105 // App extensions related methods: |
104 | 106 |
105 // Resets app_icon_ and if |extension| is non-null creates a new | 107 // Resets app_icon_ and if |extension| is non-null creates a new |
106 // ImageLoadingTracker to load the extension's image. | 108 // ImageLoadingTracker to load the extension's image. |
107 void UpdateExtensionAppIcon(const Extension* extension); | 109 void UpdateExtensionAppIcon(const Extension* extension); |
108 | 110 |
109 // ImageLoadingTracker::Observer. | 111 // ImageLoadingTracker::Observer. |
110 virtual void OnImageLoaded(SkBitmap* image, const ExtensionResource& resource, | 112 virtual void OnImageLoaded(SkBitmap* image, const ExtensionResource& resource, |
111 int index) OVERRIDE; | 113 int index) OVERRIDE; |
112 | 114 |
113 // WebstoreInlineInstaller::Delegate. | 115 // WebstoreInlineInstaller::Delegate. |
114 virtual void OnInlineInstallSuccess() OVERRIDE; | 116 virtual void OnInlineInstallSuccess(int install_id) OVERRIDE; |
115 virtual void OnInlineInstallFailure(const std::string& error) OVERRIDE; | 117 virtual void OnInlineInstallFailure(int install_id, |
| 118 const std::string& error) OVERRIDE; |
116 | 119 |
117 // Data for app extensions --------------------------------------------------- | 120 // Data for app extensions --------------------------------------------------- |
118 | 121 |
119 // If non-null this tab is an app tab and this is the extension the tab was | 122 // If non-null this tab is an app tab and this is the extension the tab was |
120 // created for. | 123 // created for. |
121 const Extension* extension_app_; | 124 const Extension* extension_app_; |
122 | 125 |
123 // Icon for extension_app_ (if non-null) or a manually-set icon for | 126 // Icon for extension_app_ (if non-null) or a manually-set icon for |
124 // non-extension apps. | 127 // non-extension apps. |
125 SkBitmap extension_app_icon_; | 128 SkBitmap extension_app_icon_; |
126 | 129 |
127 // Process any extension messages coming from the tab. | 130 // Process any extension messages coming from the tab. |
128 ExtensionFunctionDispatcher extension_function_dispatcher_; | 131 ExtensionFunctionDispatcher extension_function_dispatcher_; |
129 | 132 |
130 // Used for loading extension_app_icon_. | 133 // Used for loading extension_app_icon_. |
131 scoped_ptr<ImageLoadingTracker> extension_app_image_loader_; | 134 scoped_ptr<ImageLoadingTracker> extension_app_image_loader_; |
132 | 135 |
133 // Cached web app info data. | 136 // Cached web app info data. |
134 WebApplicationInfo web_app_info_; | 137 WebApplicationInfo web_app_info_; |
135 | 138 |
136 TabContentsWrapper* wrapper_; | 139 TabContentsWrapper* wrapper_; |
137 | 140 |
138 DISALLOW_COPY_AND_ASSIGN(ExtensionTabHelper); | 141 DISALLOW_COPY_AND_ASSIGN(ExtensionTabHelper); |
139 }; | 142 }; |
140 | 143 |
141 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TAB_HELPER_H_ | 144 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TAB_HELPER_H_ |
OLD | NEW |