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_UI_TAB_CONTENTS_TAB_CONTENTS_WRAPPER_H_ | 5 #ifndef CHROME_BROWSER_UI_TAB_CONTENTS_TAB_CONTENTS_WRAPPER_H_ |
6 #define CHROME_BROWSER_UI_TAB_CONTENTS_TAB_CONTENTS_WRAPPER_H_ | 6 #define CHROME_BROWSER_UI_TAB_CONTENTS_TAB_CONTENTS_WRAPPER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 const ExtensionTabHelper* extension_tab_helper() const { | 172 const ExtensionTabHelper* extension_tab_helper() const { |
173 return extension_tab_helper_.get(); | 173 return extension_tab_helper_.get(); |
174 } | 174 } |
175 | 175 |
176 FaviconTabHelper* favicon_tab_helper() { return favicon_tab_helper_.get(); } | 176 FaviconTabHelper* favicon_tab_helper() { return favicon_tab_helper_.get(); } |
177 FindTabHelper* find_tab_helper() { return find_tab_helper_.get(); } | 177 FindTabHelper* find_tab_helper() { return find_tab_helper_.get(); } |
178 HistoryTabHelper* history_tab_helper() { return history_tab_helper_.get(); } | 178 HistoryTabHelper* history_tab_helper() { return history_tab_helper_.get(); } |
179 InfoBarTabHelper* infobar_tab_helper() { return infobar_tab_helper_.get(); } | 179 InfoBarTabHelper* infobar_tab_helper() { return infobar_tab_helper_.get(); } |
180 PasswordManager* password_manager() { return password_manager_.get(); } | 180 PasswordManager* password_manager() { return password_manager_.get(); } |
181 | 181 |
| 182 PrefService* per_tab_prefs() { return per_tab_prefs_.get(); } |
| 183 |
182 prerender::PrerenderTabHelper* prerender_tab_helper() { | 184 prerender::PrerenderTabHelper* prerender_tab_helper() { |
183 return prerender_tab_helper_.get(); | 185 return prerender_tab_helper_.get(); |
184 } | 186 } |
185 | 187 |
186 printing::PrintViewManager* print_view_manager() { | 188 printing::PrintViewManager* print_view_manager() { |
187 return print_view_manager_.get(); | 189 return print_view_manager_.get(); |
188 } | 190 } |
189 | 191 |
190 RestoreTabHelper* restore_tab_helper() { | 192 RestoreTabHelper* restore_tab_helper() { |
191 return restore_tab_helper_.get(); | 193 return restore_tab_helper_.get(); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 // Internal helpers ---------------------------------------------------------- | 236 // Internal helpers ---------------------------------------------------------- |
235 | 237 |
236 // Message handlers. | 238 // Message handlers. |
237 void OnSnapshot(const SkBitmap& bitmap); | 239 void OnSnapshot(const SkBitmap& bitmap); |
238 void OnPDFHasUnsupportedFeature(); | 240 void OnPDFHasUnsupportedFeature(); |
239 | 241 |
240 // Returns the server that can provide alternate error pages. If the returned | 242 // Returns the server that can provide alternate error pages. If the returned |
241 // URL is empty, the default error page built into WebKit will be used. | 243 // URL is empty, the default error page built into WebKit will be used. |
242 GURL GetAlternateErrorPageURL() const; | 244 GURL GetAlternateErrorPageURL() const; |
243 | 245 |
| 246 void RegisterPerTabUserPrefs(PrefService* prefs); |
| 247 |
244 // Send the alternate error page URL to the renderer. | 248 // Send the alternate error page URL to the renderer. |
245 void UpdateAlternateErrorPageURL(RenderViewHost* rvh); | 249 void UpdateAlternateErrorPageURL(RenderViewHost* rvh); |
246 | 250 |
247 // Update the RenderView's WebPreferences. | 251 // Update the RenderView's WebPreferences. |
248 void UpdateWebPreferences(); | 252 void UpdateWebPreferences(); |
249 | 253 |
250 // Update the TabContents's RendererPreferences. | 254 // Update the TabContents's RendererPreferences. |
251 void UpdateRendererPreferences(); | 255 void UpdateRendererPreferences(); |
252 | 256 |
253 // Create or destroy SafebrowsingDetectionHost as needed if the user's | 257 // Create or destroy SafebrowsingDetectionHost as needed if the user's |
254 // safe browsing preference has changed. | 258 // safe browsing preference has changed. |
255 void UpdateSafebrowsingDetectionHost(); | 259 void UpdateSafebrowsingDetectionHost(); |
256 | 260 |
257 // Data for core operation --------------------------------------------------- | 261 // Data for core operation --------------------------------------------------- |
258 | 262 |
259 // Delegate for notifying our owner about stuff. Not owned by us. | 263 // Delegate for notifying our owner about stuff. Not owned by us. |
260 TabContentsWrapperDelegate* delegate_; | 264 TabContentsWrapperDelegate* delegate_; |
261 | 265 |
262 content::NotificationRegistrar registrar_; | 266 content::NotificationRegistrar registrar_; |
263 PrefChangeRegistrar pref_change_registrar_; | 267 PrefChangeRegistrar pref_change_registrar_; |
| 268 PrefChangeRegistrar per_tab_pref_change_registrar_; |
264 | 269 |
265 // Helper which implements the SyncedTabDelegate interface. | 270 // Helper which implements the SyncedTabDelegate interface. |
266 scoped_ptr<TabContentsWrapperSyncedTabDelegate> synced_tab_delegate_; | 271 scoped_ptr<TabContentsWrapperSyncedTabDelegate> synced_tab_delegate_; |
267 | 272 |
268 // Data for current page ----------------------------------------------------- | 273 // Data for current page ----------------------------------------------------- |
269 | 274 |
270 // Shows an info-bar to users when they search from a known search engine and | 275 // Shows an info-bar to users when they search from a known search engine and |
271 // have never used the omnibox for search before. | 276 // have never used the omnibox for search before. |
272 scoped_ptr<OmniboxSearchHint> omnibox_search_hint_; | 277 scoped_ptr<OmniboxSearchHint> omnibox_search_hint_; |
273 | 278 |
(...skipping 12 matching lines...) Expand all Loading... |
286 scoped_ptr<FaviconTabHelper> favicon_tab_helper_; | 291 scoped_ptr<FaviconTabHelper> favicon_tab_helper_; |
287 scoped_ptr<FindTabHelper> find_tab_helper_; | 292 scoped_ptr<FindTabHelper> find_tab_helper_; |
288 scoped_ptr<HistoryTabHelper> history_tab_helper_; | 293 scoped_ptr<HistoryTabHelper> history_tab_helper_; |
289 scoped_ptr<InfoBarTabHelper> infobar_tab_helper_; | 294 scoped_ptr<InfoBarTabHelper> infobar_tab_helper_; |
290 | 295 |
291 // PasswordManager and its delegate. The delegate must outlive the manager, | 296 // PasswordManager and its delegate. The delegate must outlive the manager, |
292 // per documentation in password_manager.h. | 297 // per documentation in password_manager.h. |
293 scoped_ptr<PasswordManagerDelegate> password_manager_delegate_; | 298 scoped_ptr<PasswordManagerDelegate> password_manager_delegate_; |
294 scoped_ptr<PasswordManager> password_manager_; | 299 scoped_ptr<PasswordManager> password_manager_; |
295 | 300 |
| 301 // Allows overriding user preferences. |
| 302 scoped_ptr<PrefService> per_tab_prefs_; |
| 303 |
296 scoped_ptr<prerender::PrerenderTabHelper> prerender_tab_helper_; | 304 scoped_ptr<prerender::PrerenderTabHelper> prerender_tab_helper_; |
297 | 305 |
298 // Handles print job for this contents. | 306 // Handles print job for this contents. |
299 scoped_ptr<printing::PrintViewManager> print_view_manager_; | 307 scoped_ptr<printing::PrintViewManager> print_view_manager_; |
300 | 308 |
301 scoped_ptr<RestoreTabHelper> restore_tab_helper_; | 309 scoped_ptr<RestoreTabHelper> restore_tab_helper_; |
302 | 310 |
303 // Handles displaying a web intents picker to the user. | 311 // Handles displaying a web intents picker to the user. |
304 scoped_ptr<WebIntentPickerController> web_intent_picker_controller_; | 312 scoped_ptr<WebIntentPickerController> web_intent_picker_controller_; |
305 | 313 |
(...skipping 11 matching lines...) Expand all Loading... |
317 scoped_ptr<TranslateTabHelper> translate_tab_helper_; | 325 scoped_ptr<TranslateTabHelper> translate_tab_helper_; |
318 | 326 |
319 // Per-tab observers --------------------------------------------------------- | 327 // Per-tab observers --------------------------------------------------------- |
320 // (These provide no API for callers; objects that need to exist 1:1 with tabs | 328 // (These provide no API for callers; objects that need to exist 1:1 with tabs |
321 // and silently do their thing live here.) | 329 // and silently do their thing live here.) |
322 | 330 |
323 scoped_ptr<DownloadRequestLimiterObserver> download_request_limiter_observer_; | 331 scoped_ptr<DownloadRequestLimiterObserver> download_request_limiter_observer_; |
324 scoped_ptr<ExtensionWebNavigationTabObserver> webnavigation_observer_; | 332 scoped_ptr<ExtensionWebNavigationTabObserver> webnavigation_observer_; |
325 scoped_ptr<ExternalProtocolObserver> external_protocol_observer_; | 333 scoped_ptr<ExternalProtocolObserver> external_protocol_observer_; |
326 scoped_ptr<PluginObserver> plugin_observer_; | 334 scoped_ptr<PluginObserver> plugin_observer_; |
327 scoped_ptr<PrefService> per_tab_prefs_; // Allows overriding user preferences. | |
328 scoped_ptr<printing::PrintPreviewMessageHandler> print_preview_; | 335 scoped_ptr<printing::PrintPreviewMessageHandler> print_preview_; |
329 scoped_ptr<SadTabObserver> sad_tab_observer_; | 336 scoped_ptr<SadTabObserver> sad_tab_observer_; |
330 scoped_ptr<ThumbnailGenerator> thumbnail_generation_observer_; | 337 scoped_ptr<ThumbnailGenerator> thumbnail_generation_observer_; |
331 | 338 |
332 // TabContents (MUST BE LAST) ------------------------------------------------ | 339 // TabContents (MUST BE LAST) ------------------------------------------------ |
333 | 340 |
334 // If true, we're running the destructor. | 341 // If true, we're running the destructor. |
335 bool in_destructor_; | 342 bool in_destructor_; |
336 | 343 |
337 // The supporting objects need to outlive the TabContents dtor (as they may | 344 // The supporting objects need to outlive the TabContents dtor (as they may |
338 // be called upon during its execution). As a result, this must come last | 345 // be called upon during its execution). As a result, this must come last |
339 // in the list. | 346 // in the list. |
340 scoped_ptr<TabContents> tab_contents_; | 347 scoped_ptr<TabContents> tab_contents_; |
341 | 348 |
342 DISALLOW_COPY_AND_ASSIGN(TabContentsWrapper); | 349 DISALLOW_COPY_AND_ASSIGN(TabContentsWrapper); |
343 }; | 350 }; |
344 | 351 |
345 #endif // CHROME_BROWSER_UI_TAB_CONTENTS_TAB_CONTENTS_WRAPPER_H_ | 352 #endif // CHROME_BROWSER_UI_TAB_CONTENTS_TAB_CONTENTS_WRAPPER_H_ |
OLD | NEW |