| 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/metrics/user_metrics.h" | 8 #include "base/metrics/user_metrics.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "base/timer/timer.h" | 10 #include "base/timer/timer.h" |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 DISALLOW_COPY_AND_ASSIGN(AutoSigninView); | 223 DISALLOW_COPY_AND_ASSIGN(AutoSigninView); |
| 224 }; | 224 }; |
| 225 | 225 |
| 226 ManagePasswordsBubbleView::AutoSigninView::AutoSigninView( | 226 ManagePasswordsBubbleView::AutoSigninView::AutoSigninView( |
| 227 ManagePasswordsBubbleView* parent) | 227 ManagePasswordsBubbleView* parent) |
| 228 : parent_(parent), | 228 : parent_(parent), |
| 229 observed_browser_(this) { | 229 observed_browser_(this) { |
| 230 SetLayoutManager(new views::FillLayout); | 230 SetLayoutManager(new views::FillLayout); |
| 231 const autofill::PasswordForm& form = parent_->model()->pending_password(); | 231 const autofill::PasswordForm& form = parent_->model()->pending_password(); |
| 232 CredentialsItemView* credential; | 232 CredentialsItemView* credential; |
| 233 base::string16 upper_text, lower_text = form.username_value; |
| 233 if (ChromeLayoutProvider::Get()->IsHarmonyMode()) { | 234 if (ChromeLayoutProvider::Get()->IsHarmonyMode()) { |
| 234 credential = new CredentialsItemView( | 235 upper_text = |
| 235 this, | 236 l10n_util::GetStringUTF16(IDS_MANAGE_PASSWORDS_AUTO_SIGNIN_TITLE_MD); |
| 236 l10n_util::GetStringUTF16(IDS_MANAGE_PASSWORDS_AUTO_SIGNIN_TITLE_MD), | |
| 237 form.username_value, kButtonHoverColor, &form, | |
| 238 parent_->model()->GetProfile()->GetRequestContext()); | |
| 239 } else { | 237 } else { |
| 240 credential = new CredentialsItemView( | 238 lower_text = l10n_util::GetStringFUTF16( |
| 241 this, base::string16(), | 239 IDS_MANAGE_PASSWORDS_AUTO_SIGNIN_TITLE, lower_text); |
| 242 l10n_util::GetStringFUTF16(IDS_MANAGE_PASSWORDS_AUTO_SIGNIN_TITLE, | |
| 243 form.username_value), | |
| 244 kButtonHoverColor, &form, | |
| 245 parent_->model()->GetProfile()->GetRequestContext()); | |
| 246 } | 240 } |
| 241 credential = new CredentialsItemView( |
| 242 this, upper_text, lower_text, kButtonHoverColor, &form, |
| 243 parent_->model()->GetProfile()->GetRequestContext()); |
| 247 credential->SetEnabled(false); | 244 credential->SetEnabled(false); |
| 248 AddChildView(credential); | 245 AddChildView(credential); |
| 249 | 246 |
| 250 // Setup the observer and maybe start the timer. | 247 // Setup the observer and maybe start the timer. |
| 251 Browser* browser = | 248 Browser* browser = |
| 252 chrome::FindBrowserWithWebContents(parent_->web_contents()); | 249 chrome::FindBrowserWithWebContents(parent_->web_contents()); |
| 253 DCHECK(browser); | 250 DCHECK(browser); |
| 254 | 251 |
| 255 // Sign-in dialogs opened for inactive browser windows do not auto-close on | 252 // Sign-in dialogs opened for inactive browser windows do not auto-close on |
| 256 // MacOS. This matches existing Cocoa bubble behavior. | 253 // MacOS. This matches existing Cocoa bubble behavior. |
| (...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 883 } else if (model_.state() == | 880 } else if (model_.state() == |
| 884 password_manager::ui::CHROME_DESKTOP_IOS_PROMO_STATE) { | 881 password_manager::ui::CHROME_DESKTOP_IOS_PROMO_STATE) { |
| 885 AddChildView(new DesktopIOSPromotionBubbleView( | 882 AddChildView(new DesktopIOSPromotionBubbleView( |
| 886 model_.GetProfile(), | 883 model_.GetProfile(), |
| 887 desktop_ios_promotion::PromotionEntryPoint::SAVE_PASSWORD_BUBBLE)); | 884 desktop_ios_promotion::PromotionEntryPoint::SAVE_PASSWORD_BUBBLE)); |
| 888 #endif | 885 #endif |
| 889 } else { | 886 } else { |
| 890 AddChildView(new ManageView(this)); | 887 AddChildView(new ManageView(this)); |
| 891 } | 888 } |
| 892 } | 889 } |
| OLD | NEW |