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" |
11 #include "chrome/browser/signin/signin_manager_factory.h" | 11 #include "chrome/browser/signin/signin_manager_factory.h" |
12 #include "chrome/browser/sync/profile_sync_service.h" | 12 #include "chrome/browser/sync/profile_sync_service.h" |
13 #include "chrome/browser/sync/profile_sync_service_factory.h" | 13 #include "chrome/browser/sync/profile_sync_service_factory.h" |
14 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
15 #include "chrome/browser/ui/browser_finder.h" | 15 #include "chrome/browser/ui/browser_finder.h" |
16 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller.h" | 16 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller.h" |
| 17 #include "chrome/browser/ui/passwords/manage_passwords_view_utils.h" |
17 #include "chrome/common/url_constants.h" | 18 #include "chrome/common/url_constants.h" |
18 #include "chrome/grit/chromium_strings.h" | 19 #include "chrome/grit/chromium_strings.h" |
19 #include "chrome/grit/generated_resources.h" | 20 #include "chrome/grit/generated_resources.h" |
20 #include "components/feedback/feedback_data.h" | 21 #include "components/feedback/feedback_data.h" |
21 #include "components/feedback/feedback_util.h" | 22 #include "components/feedback/feedback_util.h" |
22 #include "components/password_manager/core/browser/password_bubble_experiment.h" | 23 #include "components/password_manager/core/browser/password_bubble_experiment.h" |
23 #include "components/password_manager/core/browser/password_store.h" | 24 #include "components/password_manager/core/browser/password_store.h" |
24 #include "components/password_manager/core/common/credential_manager_types.h" | 25 #include "components/password_manager/core/common/credential_manager_types.h" |
25 #include "components/password_manager/core/common/password_manager_ui.h" | 26 #include "components/password_manager/core/common/password_manager_ui.h" |
26 #include "components/signin/core/browser/signin_manager.h" | 27 #include "components/signin/core/browser/signin_manager.h" |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 // static | 332 // static |
332 int ManagePasswordsBubbleModel::PasswordFieldWidth() { | 333 int ManagePasswordsBubbleModel::PasswordFieldWidth() { |
333 return GetFieldWidth(PASSWORD_FIELD); | 334 return GetFieldWidth(PASSWORD_FIELD); |
334 } | 335 } |
335 | 336 |
336 void ManagePasswordsBubbleModel::UpdatePendingStateTitle() { | 337 void ManagePasswordsBubbleModel::UpdatePendingStateTitle() { |
337 title_brand_link_range_ = gfx::Range(); | 338 title_brand_link_range_ = gfx::Range(); |
338 if (never_save_passwords_) { | 339 if (never_save_passwords_) { |
339 title_ = l10n_util::GetStringUTF16( | 340 title_ = l10n_util::GetStringUTF16( |
340 IDS_MANAGE_PASSWORDS_BLACKLIST_CONFIRMATION_TITLE); | 341 IDS_MANAGE_PASSWORDS_BLACKLIST_CONFIRMATION_TITLE); |
341 } else if (IsSmartLockBrandingEnabled(GetProfile())) { | |
342 // "Google Smart Lock" should be a hyperlink. | |
343 base::string16 brand_link = | |
344 l10n_util::GetStringUTF16(IDS_PASSWORD_MANAGER_SMART_LOCK); | |
345 size_t offset = 0; | |
346 title_ = l10n_util::GetStringFUTF16(IDS_SAVE_PASSWORD, brand_link, &offset); | |
347 title_brand_link_range_ = gfx::Range(offset, offset + brand_link.length()); | |
348 } else { | 342 } else { |
349 base::string16 brand_link = | 343 // GURL form_url("https://example.com:8001/login#form?value=3"); |
350 l10n_util::GetStringUTF16(IDS_SAVE_PASSWORD_TITLE_BRAND); | 344 GetSavePasswordTitleTextAndLinkRange( |
351 title_ = l10n_util::GetStringFUTF16(IDS_SAVE_PASSWORD, brand_link); | 345 web_contents(), origin(), IsSmartLockBrandingEnabled(GetProfile()), |
| 346 &title_, &title_brand_link_range_); |
352 } | 347 } |
353 } | 348 } |
OLD | NEW |