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/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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 thumbnail_generator_.reset(new ThumbnailGenerator); | 158 thumbnail_generator_.reset(new ThumbnailGenerator); |
159 thumbnail_generator_->StartThumbnailing(web_contents_.get()); | 159 thumbnail_generator_->StartThumbnailing(web_contents_.get()); |
160 } | 160 } |
161 | 161 |
162 // If this is not an incognito window, setup to handle one-click login. | 162 // If this is not an incognito window, setup to handle one-click login. |
163 // We don't want to check that the profile is already connected at this time | 163 // We don't want to check that the profile is already connected at this time |
164 // because the connected state may change while this tab is open. Having a | 164 // because the connected state may change while this tab is open. Having a |
165 // one-click signin helper attached does not cause problems if the profile | 165 // one-click signin helper attached does not cause problems if the profile |
166 // happens to be already connected. | 166 // happens to be already connected. |
167 #if defined(ENABLE_ONE_CLICK_SIGNIN) | 167 #if defined(ENABLE_ONE_CLICK_SIGNIN) |
168 if (OneClickSigninHelper::CanOffer(contents, false)) | 168 if (OneClickSigninHelper::CanOffer(contents, "", false)) |
169 one_click_signin_helper_.reset(new OneClickSigninHelper(contents)); | 169 one_click_signin_helper_.reset(new OneClickSigninHelper(contents)); |
170 #endif | 170 #endif |
171 } | 171 } |
172 | 172 |
173 TabContents::~TabContents() { | 173 TabContents::~TabContents() { |
174 in_destructor_ = true; | 174 in_destructor_ = true; |
175 | 175 |
176 // Need to reset |thumbnail_generator_| here before |web_contents_| is | 176 // Need to reset |thumbnail_generator_| here before |web_contents_| is |
177 // deleted because destructing |web_contents_| can end up causing the | 177 // deleted because destructing |web_contents_| can end up causing the |
178 // thumbnailer to generate a thumbnail. Since TabContents can be | 178 // thumbnailer to generate a thumbnail. Since TabContents can be |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 | 234 |
235 //////////////////////////////////////////////////////////////////////////////// | 235 //////////////////////////////////////////////////////////////////////////////// |
236 // WebContentsObserver overrides | 236 // WebContentsObserver overrides |
237 | 237 |
238 void TabContents::WebContentsDestroyed(WebContents* tab) { | 238 void TabContents::WebContentsDestroyed(WebContents* tab) { |
239 // Destruction of the WebContents should only be done by us from our | 239 // Destruction of the WebContents should only be done by us from our |
240 // destructor. Otherwise it's very likely we (or one of the helpers we own) | 240 // destructor. Otherwise it's very likely we (or one of the helpers we own) |
241 // will attempt to access the WebContents and we'll crash. | 241 // will attempt to access the WebContents and we'll crash. |
242 DCHECK(in_destructor_); | 242 DCHECK(in_destructor_); |
243 } | 243 } |
OLD | NEW |