| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/views/passwords/manage_passwords_bubble_view.h" | 5 #include "chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "base/timer/timer.h" | 9 #include "base/timer/timer.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 DISALLOW_COPY_AND_ASSIGN(AutoSigninView); | 217 DISALLOW_COPY_AND_ASSIGN(AutoSigninView); |
| 218 }; | 218 }; |
| 219 | 219 |
| 220 ManagePasswordsBubbleView::AutoSigninView::AutoSigninView( | 220 ManagePasswordsBubbleView::AutoSigninView::AutoSigninView( |
| 221 ManagePasswordsBubbleView* parent) | 221 ManagePasswordsBubbleView* parent) |
| 222 : parent_(parent), | 222 : parent_(parent), |
| 223 observed_browser_(this) { | 223 observed_browser_(this) { |
| 224 SetLayoutManager(new views::FillLayout); | 224 SetLayoutManager(new views::FillLayout); |
| 225 const autofill::PasswordForm& form = parent_->model()->pending_password(); | 225 const autofill::PasswordForm& form = parent_->model()->pending_password(); |
| 226 CredentialsItemView* credential = new CredentialsItemView( | 226 CredentialsItemView* credential = new CredentialsItemView( |
| 227 this, &form, | 227 this, |
| 228 password_manager::CredentialType::CREDENTIAL_TYPE_PASSWORD, | |
| 229 base::string16(), | 228 base::string16(), |
| 230 l10n_util::GetStringFUTF16(IDS_MANAGE_PASSWORDS_AUTO_SIGNIN_TITLE, | 229 l10n_util::GetStringFUTF16(IDS_MANAGE_PASSWORDS_AUTO_SIGNIN_TITLE, |
| 231 form.username_value), | 230 form.username_value), |
| 231 GetNativeTheme()->GetSystemColor( |
| 232 ui::NativeTheme::kColorId_ButtonBackgroundColor), |
| 233 &form, |
| 232 parent_->model()->GetProfile()->GetRequestContext()); | 234 parent_->model()->GetProfile()->GetRequestContext()); |
| 233 credential->SetEnabled(false); | 235 credential->SetEnabled(false); |
| 234 AddChildView(credential); | 236 AddChildView(credential); |
| 235 | 237 |
| 236 // Setup the observer and maybe start the timer. | 238 // Setup the observer and maybe start the timer. |
| 237 Browser* browser = | 239 Browser* browser = |
| 238 chrome::FindBrowserWithWebContents(parent_->web_contents()); | 240 chrome::FindBrowserWithWebContents(parent_->web_contents()); |
| 239 DCHECK(browser); | 241 DCHECK(browser); |
| 240 BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser); | 242 BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser); |
| 241 observed_browser_.Add(browser_view->GetWidget()); | 243 observed_browser_.Add(browser_view->GetWidget()); |
| (...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 830 AddChildView(new SaveConfirmationView(this)); | 832 AddChildView(new SaveConfirmationView(this)); |
| 831 } else if (model_.state() == password_manager::ui::AUTO_SIGNIN_STATE) { | 833 } else if (model_.state() == password_manager::ui::AUTO_SIGNIN_STATE) { |
| 832 AddChildView(new AutoSigninView(this)); | 834 AddChildView(new AutoSigninView(this)); |
| 833 } else { | 835 } else { |
| 834 AddChildView(new ManageView(this)); | 836 AddChildView(new ManageView(this)); |
| 835 } | 837 } |
| 836 if (GetWidget()) | 838 if (GetWidget()) |
| 837 GetWidget()->UpdateWindowTitle(); | 839 GetWidget()->UpdateWindowTitle(); |
| 838 GetLayoutManager()->Layout(this); | 840 GetLayoutManager()->Layout(this); |
| 839 } | 841 } |
| OLD | NEW |