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" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 autocomplete_history_manager_.reset(new AutocompleteHistoryManager(contents)); | 74 autocomplete_history_manager_.reset(new AutocompleteHistoryManager(contents)); |
75 autofill_manager_ = new AutofillManager(this); | 75 autofill_manager_ = new AutofillManager(this); |
76 if (CommandLine::ForCurrentProcess()->HasSwitch( | 76 if (CommandLine::ForCurrentProcess()->HasSwitch( |
77 switches::kExternalAutofillPopup)) { | 77 switches::kExternalAutofillPopup)) { |
78 autofill_external_delegate_.reset( | 78 autofill_external_delegate_.reset( |
79 AutofillExternalDelegate::Create(this, autofill_manager_.get())); | 79 AutofillExternalDelegate::Create(this, autofill_manager_.get())); |
80 autofill_manager_->SetExternalDelegate(autofill_external_delegate_.get()); | 80 autofill_manager_->SetExternalDelegate(autofill_external_delegate_.get()); |
81 autocomplete_history_manager_->SetExternalDelegate( | 81 autocomplete_history_manager_->SetExternalDelegate( |
82 autofill_external_delegate_.get()); | 82 autofill_external_delegate_.get()); |
83 } | 83 } |
| 84 #if defined(ENABLE_AUTOMATION) |
84 automation_tab_helper_.reset(new AutomationTabHelper(contents)); | 85 automation_tab_helper_.reset(new AutomationTabHelper(contents)); |
| 86 #endif |
85 blocked_content_tab_helper_.reset(new BlockedContentTabHelper(this)); | 87 blocked_content_tab_helper_.reset(new BlockedContentTabHelper(this)); |
86 bookmark_tab_helper_.reset(new BookmarkTabHelper(this)); | 88 bookmark_tab_helper_.reset(new BookmarkTabHelper(this)); |
87 constrained_window_tab_helper_.reset(new ConstrainedWindowTabHelper(this)); | 89 constrained_window_tab_helper_.reset(new ConstrainedWindowTabHelper(this)); |
88 core_tab_helper_.reset(new CoreTabHelper(contents)); | 90 core_tab_helper_.reset(new CoreTabHelper(contents)); |
89 extension_tab_helper_.reset(new ExtensionTabHelper(this)); | 91 extension_tab_helper_.reset(new ExtensionTabHelper(this)); |
90 favicon_tab_helper_.reset(new FaviconTabHelper(contents)); | 92 favicon_tab_helper_.reset(new FaviconTabHelper(contents)); |
91 find_tab_helper_.reset(new FindTabHelper(contents)); | 93 find_tab_helper_.reset(new FindTabHelper(contents)); |
92 history_tab_helper_.reset(new HistoryTabHelper(contents)); | 94 history_tab_helper_.reset(new HistoryTabHelper(contents)); |
93 infobar_tab_helper_.reset(new InfoBarTabHelper(contents)); | 95 infobar_tab_helper_.reset(new InfoBarTabHelper(contents)); |
94 password_manager_delegate_.reset(new PasswordManagerDelegateImpl(this)); | 96 password_manager_delegate_.reset(new PasswordManagerDelegateImpl(this)); |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 | 204 |
203 //////////////////////////////////////////////////////////////////////////////// | 205 //////////////////////////////////////////////////////////////////////////////// |
204 // WebContentsObserver overrides | 206 // WebContentsObserver overrides |
205 | 207 |
206 void TabContentsWrapper::WebContentsDestroyed(WebContents* tab) { | 208 void TabContentsWrapper::WebContentsDestroyed(WebContents* tab) { |
207 // Destruction of the WebContents should only be done by us from our | 209 // Destruction of the WebContents should only be done by us from our |
208 // destructor. Otherwise it's very likely we (or one of the helpers we own) | 210 // destructor. Otherwise it's very likely we (or one of the helpers we own) |
209 // will attempt to access the TabContents and we'll crash. | 211 // will attempt to access the TabContents and we'll crash. |
210 DCHECK(in_destructor_); | 212 DCHECK(in_destructor_); |
211 } | 213 } |
OLD | NEW |