| 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 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 5 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
| 9 #include "chrome/browser/autocomplete_history_manager.h" | 9 #include "chrome/browser/autocomplete_history_manager.h" |
| 10 #include "chrome/browser/autofill/autofill_external_delegate.h" | 10 #include "chrome/browser/autofill/autofill_external_delegate.h" |
| 11 #include "chrome/browser/autofill/autofill_manager.h" | 11 #include "chrome/browser/autofill/autofill_manager.h" |
| 12 #include "chrome/browser/automation/automation_tab_helper.h" | 12 #include "chrome/browser/automation/automation_tab_helper.h" |
| 13 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 13 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 14 #include "chrome/browser/download/download_request_limiter_observer.h" | 14 #include "chrome/browser/download/download_request_limiter_observer.h" |
| 15 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h" | 15 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h" |
| 16 #include "chrome/browser/extensions/extension_tab_helper.h" | 16 #include "chrome/browser/extensions/extension_tab_helper.h" |
| 17 #include "chrome/browser/extensions/page_action_controller.h" | |
| 18 #include "chrome/browser/extensions/script_executor_impl.h" | |
| 19 #include "chrome/browser/external_protocol/external_protocol_observer.h" | 17 #include "chrome/browser/external_protocol/external_protocol_observer.h" |
| 20 #include "chrome/browser/favicon/favicon_tab_helper.h" | 18 #include "chrome/browser/favicon/favicon_tab_helper.h" |
| 21 #include "chrome/browser/history/history_tab_helper.h" | 19 #include "chrome/browser/history/history_tab_helper.h" |
| 22 #include "chrome/browser/infobars/infobar_tab_helper.h" | 20 #include "chrome/browser/infobars/infobar_tab_helper.h" |
| 23 #include "chrome/browser/omnibox_search_hint.h" | 21 #include "chrome/browser/omnibox_search_hint.h" |
| 24 #include "chrome/browser/password_manager/password_manager.h" | 22 #include "chrome/browser/password_manager/password_manager.h" |
| 25 #include "chrome/browser/password_manager_delegate_impl.h" | 23 #include "chrome/browser/password_manager_delegate_impl.h" |
| 26 #include "chrome/browser/plugin_observer.h" | 24 #include "chrome/browser/plugin_observer.h" |
| 27 #include "chrome/browser/prerender/prerender_tab_helper.h" | 25 #include "chrome/browser/prerender/prerender_tab_helper.h" |
| 28 #include "chrome/browser/printing/print_preview_message_handler.h" | 26 #include "chrome/browser/printing/print_preview_message_handler.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 autofill_external_delegate_.get()); | 86 autofill_external_delegate_.get()); |
| 89 } | 87 } |
| 90 #if defined(ENABLE_AUTOMATION) | 88 #if defined(ENABLE_AUTOMATION) |
| 91 automation_tab_helper_.reset(new AutomationTabHelper(contents)); | 89 automation_tab_helper_.reset(new AutomationTabHelper(contents)); |
| 92 #endif | 90 #endif |
| 93 blocked_content_tab_helper_.reset(new BlockedContentTabHelper(this)); | 91 blocked_content_tab_helper_.reset(new BlockedContentTabHelper(this)); |
| 94 bookmark_tab_helper_.reset(new BookmarkTabHelper(this)); | 92 bookmark_tab_helper_.reset(new BookmarkTabHelper(this)); |
| 95 constrained_window_tab_helper_.reset(new ConstrainedWindowTabHelper(this)); | 93 constrained_window_tab_helper_.reset(new ConstrainedWindowTabHelper(this)); |
| 96 core_tab_helper_.reset(new CoreTabHelper(contents)); | 94 core_tab_helper_.reset(new CoreTabHelper(contents)); |
| 97 extension_tab_helper_.reset(new ExtensionTabHelper(this)); | 95 extension_tab_helper_.reset(new ExtensionTabHelper(this)); |
| 98 extension_script_executor_.reset( | |
| 99 new extensions::ScriptExecutorImpl(web_contents())); | |
| 100 extension_action_box_controller_.reset( | |
| 101 new extensions::PageActionController(this)); | |
| 102 favicon_tab_helper_.reset(new FaviconTabHelper(contents)); | 96 favicon_tab_helper_.reset(new FaviconTabHelper(contents)); |
| 103 find_tab_helper_.reset(new FindTabHelper(contents)); | 97 find_tab_helper_.reset(new FindTabHelper(contents)); |
| 104 history_tab_helper_.reset(new HistoryTabHelper(contents)); | 98 history_tab_helper_.reset(new HistoryTabHelper(contents)); |
| 105 hung_plugin_tab_helper_.reset(new HungPluginTabHelper(contents)); | 99 hung_plugin_tab_helper_.reset(new HungPluginTabHelper(contents)); |
| 106 infobar_tab_helper_.reset(new InfoBarTabHelper(contents)); | 100 infobar_tab_helper_.reset(new InfoBarTabHelper(contents)); |
| 107 password_manager_delegate_.reset(new PasswordManagerDelegateImpl(this)); | 101 password_manager_delegate_.reset(new PasswordManagerDelegateImpl(this)); |
| 108 password_manager_.reset( | 102 password_manager_.reset( |
| 109 new PasswordManager(contents, password_manager_delegate_.get())); | 103 new PasswordManager(contents, password_manager_delegate_.get())); |
| 110 prefs_tab_helper_.reset(new PrefsTabHelper(contents)); | 104 prefs_tab_helper_.reset(new PrefsTabHelper(contents)); |
| 111 prerender_tab_helper_.reset(new prerender::PrerenderTabHelper(this)); | 105 prerender_tab_helper_.reset(new prerender::PrerenderTabHelper(this)); |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 | 209 |
| 216 //////////////////////////////////////////////////////////////////////////////// | 210 //////////////////////////////////////////////////////////////////////////////// |
| 217 // WebContentsObserver overrides | 211 // WebContentsObserver overrides |
| 218 | 212 |
| 219 void TabContentsWrapper::WebContentsDestroyed(WebContents* tab) { | 213 void TabContentsWrapper::WebContentsDestroyed(WebContents* tab) { |
| 220 // Destruction of the WebContents should only be done by us from our | 214 // Destruction of the WebContents should only be done by us from our |
| 221 // destructor. Otherwise it's very likely we (or one of the helpers we own) | 215 // destructor. Otherwise it's very likely we (or one of the helpers we own) |
| 222 // will attempt to access the WebContents and we'll crash. | 216 // will attempt to access the WebContents and we'll crash. |
| 223 DCHECK(in_destructor_); | 217 DCHECK(in_destructor_); |
| 224 } | 218 } |
| OLD | NEW |