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.h" | 5 #include "chrome/browser/ui/tab_contents/tab_contents.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/autofill/autocomplete_history_manager.h" | 9 #include "chrome/browser/autofill/autocomplete_history_manager.h" |
10 #include "chrome/browser/autofill/autofill_external_delegate.h" | 10 #include "chrome/browser/autofill/autofill_external_delegate.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 // SessionTabHelper comes first because it sets up the tab ID, and other | 111 // SessionTabHelper comes first because it sets up the tab ID, and other |
112 // helpers may rely on that. | 112 // helpers may rely on that. |
113 SessionTabHelper::CreateForWebContents(contents); | 113 SessionTabHelper::CreateForWebContents(contents); |
114 | 114 |
115 AlternateErrorPageTabObserver::CreateForWebContents(contents); | 115 AlternateErrorPageTabObserver::CreateForWebContents(contents); |
116 AutocompleteHistoryManager::CreateForWebContents(contents); | 116 AutocompleteHistoryManager::CreateForWebContents(contents); |
117 TabAutofillManagerDelegate::CreateForWebContents(contents); | 117 TabAutofillManagerDelegate::CreateForWebContents(contents); |
118 AutofillManager::CreateForWebContentsAndDelegate( | 118 AutofillManager::CreateForWebContentsAndDelegate( |
119 contents, TabAutofillManagerDelegate::FromWebContents(contents)); | 119 contents, TabAutofillManagerDelegate::FromWebContents(contents)); |
120 if (CommandLine::ForCurrentProcess()->HasSwitch( | 120 if (CommandLine::ForCurrentProcess()->HasSwitch( |
121 switches::kExternalAutofillPopup)) { | 121 switches::kEnableNewAutofillUi)) { |
122 AutofillExternalDelegate::CreateForWebContentsAndManager( | 122 AutofillExternalDelegate::CreateForWebContentsAndManager( |
123 contents, AutofillManager::FromWebContents(contents)); | 123 contents, AutofillManager::FromWebContents(contents)); |
124 AutofillManager::FromWebContents(contents)->SetExternalDelegate( | 124 AutofillManager::FromWebContents(contents)->SetExternalDelegate( |
125 AutofillExternalDelegate::FromWebContents(contents)); | 125 AutofillExternalDelegate::FromWebContents(contents)); |
126 AutocompleteHistoryManager::FromWebContents(contents)->SetExternalDelegate( | 126 AutocompleteHistoryManager::FromWebContents(contents)->SetExternalDelegate( |
127 AutofillExternalDelegate::FromWebContents(contents)); | 127 AutofillExternalDelegate::FromWebContents(contents)); |
128 } | 128 } |
129 BlockedContentTabHelper::CreateForWebContents(contents); | 129 BlockedContentTabHelper::CreateForWebContents(contents); |
130 BookmarkTabHelper::CreateForWebContents(contents); | 130 BookmarkTabHelper::CreateForWebContents(contents); |
131 chrome_browser_net::LoadTimeStatsTabHelper::CreateForWebContents(contents); | 131 chrome_browser_net::LoadTimeStatsTabHelper::CreateForWebContents(contents); |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 | 226 |
227 //////////////////////////////////////////////////////////////////////////////// | 227 //////////////////////////////////////////////////////////////////////////////// |
228 // WebContentsObserver overrides | 228 // WebContentsObserver overrides |
229 | 229 |
230 void TabContents::WebContentsDestroyed(WebContents* tab) { | 230 void TabContents::WebContentsDestroyed(WebContents* tab) { |
231 // Destruction of the WebContents should only be done by us from our | 231 // Destruction of the WebContents should only be done by us from our |
232 // destructor. Otherwise it's very likely we (or one of the helpers we own) | 232 // destructor. Otherwise it's very likely we (or one of the helpers we own) |
233 // will attempt to access the WebContents and we'll crash. | 233 // will attempt to access the WebContents and we'll crash. |
234 DCHECK(in_destructor_); | 234 DCHECK(in_destructor_); |
235 } | 235 } |
OLD | NEW |