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/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "chrome/browser/autofill/autofill_external_delegate.h" | 10 #include "chrome/browser/autofill/autofill_external_delegate.h" |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 printing::PrintPreviewMessageHandler::CreateForWebContents(contents); | 181 printing::PrintPreviewMessageHandler::CreateForWebContents(contents); |
182 printing::PrintViewManager::CreateForWebContents(contents); | 182 printing::PrintViewManager::CreateForWebContents(contents); |
183 #endif | 183 #endif |
184 | 184 |
185 #if defined(ENABLE_ONE_CLICK_SIGNIN) | 185 #if defined(ENABLE_ONE_CLICK_SIGNIN) |
186 // If this is not an incognito window, setup to handle one-click login. | 186 // If this is not an incognito window, setup to handle one-click login. |
187 // We don't want to check that the profile is already connected at this time | 187 // We don't want to check that the profile is already connected at this time |
188 // because the connected state may change while this tab is open. Having a | 188 // because the connected state may change while this tab is open. Having a |
189 // one-click signin helper attached does not cause problems if the profile | 189 // one-click signin helper attached does not cause problems if the profile |
190 // happens to be already connected. | 190 // happens to be already connected. |
191 if (OneClickSigninHelper::CanOffer(contents, "", false)) | 191 if (OneClickSigninHelper::CanOffer(contents, |
192 OneClickSigninHelper::CreateForWebContents(contents); | 192 OneClickSigninHelper::CAN_OFFER_FOR_ALL, "", NULL)) |
| 193 OneClickSigninHelper::CreateForWebContents(contents); |
193 #endif | 194 #endif |
194 | 195 |
195 #if defined(OS_WIN) | 196 #if defined(OS_WIN) |
196 MetroPinTabHelper::CreateForWebContents(contents); | 197 MetroPinTabHelper::CreateForWebContents(contents); |
197 #endif | 198 #endif |
198 } | 199 } |
199 | 200 |
200 TabContents::~TabContents() { | 201 TabContents::~TabContents() { |
201 in_destructor_ = true; | 202 in_destructor_ = true; |
202 } | 203 } |
(...skipping 27 matching lines...) Expand all Loading... |
230 | 231 |
231 void TabContents::WebContentsDestroyed(WebContents* tab) { | 232 void TabContents::WebContentsDestroyed(WebContents* tab) { |
232 if (!in_destructor_) { | 233 if (!in_destructor_) { |
233 // The owned WebContents is being destroyed independently, so delete this. | 234 // The owned WebContents is being destroyed independently, so delete this. |
234 ignore_result(owned_web_contents_.release()); | 235 ignore_result(owned_web_contents_.release()); |
235 TabContentsUserData* user_data = static_cast<TabContentsUserData*>( | 236 TabContentsUserData* user_data = static_cast<TabContentsUserData*>( |
236 tab->GetUserData(&kTabContentsUserDataKey)); | 237 tab->GetUserData(&kTabContentsUserDataKey)); |
237 user_data->MakeContentsOwned(); | 238 user_data->MakeContentsOwned(); |
238 } | 239 } |
239 } | 240 } |
OLD | NEW |