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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
110 | 110 |
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 !defined(OS_ANDROID) | |
Albert Bodenhamer
2012/10/19 16:46:52
Wrapping an if() in a conditional compile like thi
joth
2012/10/19 22:04:06
Android is just about to stop using tab_contents.c
Ilya Sherman
2012/10/19 22:16:26
Given joth's comment, I've left the code in androi
| |
120 if (CommandLine::ForCurrentProcess()->HasSwitch( | 121 if (CommandLine::ForCurrentProcess()->HasSwitch( |
121 switches::kExternalAutofillPopup)) { | 122 switches::kEnableNewAutofillUi)) { |
123 #else | |
124 // Always enable the external popup on Android. | |
125 if (true) { | |
126 #endif | |
122 AutofillExternalDelegate::CreateForWebContentsAndManager( | 127 AutofillExternalDelegate::CreateForWebContentsAndManager( |
123 contents, AutofillManager::FromWebContents(contents)); | 128 contents, AutofillManager::FromWebContents(contents)); |
124 AutofillManager::FromWebContents(contents)->SetExternalDelegate( | 129 AutofillManager::FromWebContents(contents)->SetExternalDelegate( |
125 AutofillExternalDelegate::FromWebContents(contents)); | 130 AutofillExternalDelegate::FromWebContents(contents)); |
126 AutocompleteHistoryManager::FromWebContents(contents)->SetExternalDelegate( | 131 AutocompleteHistoryManager::FromWebContents(contents)->SetExternalDelegate( |
127 AutofillExternalDelegate::FromWebContents(contents)); | 132 AutofillExternalDelegate::FromWebContents(contents)); |
128 } | 133 } |
129 BlockedContentTabHelper::CreateForWebContents(contents); | 134 BlockedContentTabHelper::CreateForWebContents(contents); |
130 BookmarkTabHelper::CreateForWebContents(contents); | 135 BookmarkTabHelper::CreateForWebContents(contents); |
131 chrome_browser_net::LoadTimeStatsTabHelper::CreateForWebContents(contents); | 136 chrome_browser_net::LoadTimeStatsTabHelper::CreateForWebContents(contents); |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
226 | 231 |
227 //////////////////////////////////////////////////////////////////////////////// | 232 //////////////////////////////////////////////////////////////////////////////// |
228 // WebContentsObserver overrides | 233 // WebContentsObserver overrides |
229 | 234 |
230 void TabContents::WebContentsDestroyed(WebContents* tab) { | 235 void TabContents::WebContentsDestroyed(WebContents* tab) { |
231 // Destruction of the WebContents should only be done by us from our | 236 // 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) | 237 // 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. | 238 // will attempt to access the WebContents and we'll crash. |
234 DCHECK(in_destructor_); | 239 DCHECK(in_destructor_); |
235 } | 240 } |
OLD | NEW |