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