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 int error_message_id = 0; |
192 OneClickSigninHelper::CreateForWebContents(contents); | 192 if (OneClickSigninHelper::CanOffer(contents, |
Andrew T Wilson (Slow)
2012/12/03 14:54:49
Consider just passing null here for error_message_
Roger Tawa OOO till Jul 10th
2012/12/03 22:26:54
Done.
| |
193 OneClickSigninHelper::CAN_OFFER_FOR_ALL, "", &error_message_id)) | |
194 OneClickSigninHelper::CreateForWebContents(contents); | |
193 #endif | 195 #endif |
194 | 196 |
195 #if defined(OS_WIN) | 197 #if defined(OS_WIN) |
196 MetroPinTabHelper::CreateForWebContents(contents); | 198 MetroPinTabHelper::CreateForWebContents(contents); |
197 #endif | 199 #endif |
198 } | 200 } |
199 | 201 |
200 TabContents::~TabContents() { | 202 TabContents::~TabContents() { |
201 in_destructor_ = true; | 203 in_destructor_ = true; |
202 } | 204 } |
(...skipping 27 matching lines...) Expand all Loading... | |
230 | 232 |
231 void TabContents::WebContentsDestroyed(WebContents* tab) { | 233 void TabContents::WebContentsDestroyed(WebContents* tab) { |
232 if (!in_destructor_) { | 234 if (!in_destructor_) { |
233 // The owned WebContents is being destroyed independently, so delete this. | 235 // The owned WebContents is being destroyed independently, so delete this. |
234 ignore_result(owned_web_contents_.release()); | 236 ignore_result(owned_web_contents_.release()); |
235 TabContentsUserData* user_data = static_cast<TabContentsUserData*>( | 237 TabContentsUserData* user_data = static_cast<TabContentsUserData*>( |
236 tab->GetUserData(&kTabContentsUserDataKey)); | 238 tab->GetUserData(&kTabContentsUserDataKey)); |
237 user_data->MakeContentsOwned(); | 239 user_data->MakeContentsOwned(); |
238 } | 240 } |
239 } | 241 } |
OLD | NEW |