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/passwords/manage_passwords_bubble_model.h" | 5 #include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/browser/password_manager/password_store_factory.h" | 9 #include "chrome/browser/password_manager/password_store_factory.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 // There is no title. | 111 // There is no title. |
112 } else { | 112 } else { |
113 title_ = IsNewUIActive() ? | 113 title_ = IsNewUIActive() ? |
114 l10n_util::GetStringFUTF16(IDS_MANAGE_ACCOUNTS_TITLE, | 114 l10n_util::GetStringFUTF16(IDS_MANAGE_ACCOUNTS_TITLE, |
115 base::UTF8ToUTF16(origin_.spec())) : | 115 base::UTF8ToUTF16(origin_.spec())) : |
116 l10n_util::GetStringUTF16(IDS_MANAGE_PASSWORDS_TITLE); | 116 l10n_util::GetStringUTF16(IDS_MANAGE_PASSWORDS_TITLE); |
117 } | 117 } |
118 | 118 |
119 if (state_ == password_manager::ui::CONFIRMATION_STATE) { | 119 if (state_ == password_manager::ui::CONFIRMATION_STATE) { |
120 base::string16 save_confirmation_link = | 120 base::string16 save_confirmation_link = |
121 l10n_util::GetStringUTF16(IDS_MANAGE_PASSWORDS_CONFIRM_GENERATED_LINK); | 121 l10n_util::GetStringUTF16(IDS_MANAGE_PASSWORDS_LINK); |
122 size_t offset; | 122 size_t offset; |
123 save_confirmation_text_ = | 123 save_confirmation_text_ = |
124 l10n_util::GetStringFUTF16(IDS_MANAGE_PASSWORDS_CONFIRM_GENERATED_TEXT, | 124 l10n_util::GetStringFUTF16(IDS_MANAGE_PASSWORDS_CONFIRM_GENERATED_TEXT, |
125 save_confirmation_link, &offset); | 125 save_confirmation_link, &offset); |
126 save_confirmation_link_range_ = | 126 save_confirmation_link_range_ = |
127 gfx::Range(offset, offset + save_confirmation_link.length()); | 127 gfx::Range(offset, offset + save_confirmation_link.length()); |
128 } | 128 } |
129 | 129 |
130 manage_link_ = | 130 manage_link_ = |
131 l10n_util::GetStringUTF16(IDS_OPTIONS_PASSWORDS_MANAGE_PASSWORDS_LINK); | 131 l10n_util::GetStringUTF16(IDS_OPTIONS_PASSWORDS_MANAGE_PASSWORDS_LINK); |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 // static | 306 // static |
307 int ManagePasswordsBubbleModel::PasswordFieldWidth() { | 307 int ManagePasswordsBubbleModel::PasswordFieldWidth() { |
308 return GetFieldWidth(PASSWORD_FIELD); | 308 return GetFieldWidth(PASSWORD_FIELD); |
309 } | 309 } |
310 | 310 |
311 void ManagePasswordsBubbleModel::UpdatePendingStateTitle() { | 311 void ManagePasswordsBubbleModel::UpdatePendingStateTitle() { |
312 title_brand_link_range_ = gfx::Range(); | 312 title_brand_link_range_ = gfx::Range(); |
313 if (never_save_passwords_) { | 313 if (never_save_passwords_) { |
314 title_ = l10n_util::GetStringUTF16( | 314 title_ = l10n_util::GetStringUTF16( |
315 IDS_MANAGE_PASSWORDS_BLACKLIST_CONFIRMATION_TITLE); | 315 IDS_MANAGE_PASSWORDS_BLACKLIST_CONFIRMATION_TITLE); |
316 } else if (password_bubble_experiment::IsEnabledSmartLockBranding( | 316 } else if (password_bubble_experiment::IsSmartLockBrandingEnabled( |
317 GetProfile())) { | 317 GetProfile())) { |
318 // "Google Smart Lock" should be a hyperlink. | 318 // "Google Smart Lock" should be a hyperlink. |
319 base::string16 brand_link = | 319 base::string16 brand_link = |
320 l10n_util::GetStringUTF16(IDS_PASSWORD_MANAGER_SMART_LOCK); | 320 l10n_util::GetStringUTF16(IDS_PASSWORD_MANAGER_SMART_LOCK); |
321 size_t offset = 0; | 321 size_t offset = 0; |
322 title_ = l10n_util::GetStringFUTF16(IDS_SAVE_PASSWORD, brand_link, &offset); | 322 title_ = l10n_util::GetStringFUTF16(IDS_SAVE_PASSWORD, brand_link, &offset); |
323 title_brand_link_range_ = gfx::Range(offset, offset + brand_link.length()); | 323 title_brand_link_range_ = gfx::Range(offset, offset + brand_link.length()); |
324 } else { | 324 } else { |
325 base::string16 brand_link = | 325 base::string16 brand_link = |
326 l10n_util::GetStringUTF16(IDS_SAVE_PASSWORD_TITLE_BRAND); | 326 l10n_util::GetStringUTF16(IDS_SAVE_PASSWORD_TITLE_BRAND); |
327 title_ = l10n_util::GetStringFUTF16(IDS_SAVE_PASSWORD, brand_link); | 327 title_ = l10n_util::GetStringFUTF16(IDS_SAVE_PASSWORD, brand_link); |
328 } | 328 } |
329 } | 329 } |
OLD | NEW |