Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Side by Side Diff: chrome/browser/ui/passwords/manage_passwords_view_utils.cc

Issue 1171333003: Move net::FormatUrl and friends outside of //net and into //components (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase again now that CQ is fixed Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_view_utils.h" 5 #include "chrome/browser/ui/passwords/manage_passwords_view_utils.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "chrome/grit/chromium_strings.h" 8 #include "chrome/grit/chromium_strings.h"
9 #include "chrome/grit/generated_resources.h" 9 #include "chrome/grit/generated_resources.h"
10 #include "components/password_manager/core/browser/affiliation_utils.h" 10 #include "components/password_manager/core/browser/affiliation_utils.h"
11 #include "components/secure_display/elide_url.h" 11 #include "components/url_formatter/elide_url.h"
12 #include "net/base/net_util.h" 12 #include "net/base/net_util.h"
13 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" 13 #include "net/base/registry_controlled_domains/registry_controlled_domain.h"
14 #include "ui/base/l10n/l10n_util.h" 14 #include "ui/base/l10n/l10n_util.h"
15 #include "ui/gfx/geometry/rect.h" 15 #include "ui/gfx/geometry/rect.h"
16 #include "ui/gfx/geometry/size.h" 16 #include "ui/gfx/geometry/size.h"
17 #include "ui/gfx/image/image_skia.h" 17 #include "ui/gfx/image/image_skia.h"
18 #include "ui/gfx/image/image_skia_operations.h" 18 #include "ui/gfx/image/image_skia_operations.h"
19 #include "ui/gfx/range/range.h" 19 #include "ui/gfx/range/range.h"
20 #include "url/gurl.h" 20 #include "url/gurl.h"
21 21
(...skipping 27 matching lines...) Expand all
49 49
50 // Check whether the registry controlled domains for user-visible URL (i.e. 50 // Check whether the registry controlled domains for user-visible URL (i.e.
51 // the one seen in the omnibox) and the password form post-submit navigation 51 // the one seen in the omnibox) and the password form post-submit navigation
52 // URL differs or not. 52 // URL differs or not.
53 bool target_domain_differs = 53 bool target_domain_differs =
54 !net::registry_controlled_domains::SameDomainOrHost( 54 !net::registry_controlled_domains::SameDomainOrHost(
55 user_visible_url, form_origin_url, 55 user_visible_url, form_origin_url,
56 net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES); 56 net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES);
57 if (target_domain_differs) { 57 if (target_domain_differs) {
58 title_id = IDS_SAVE_PASSWORD_TITLE; 58 title_id = IDS_SAVE_PASSWORD_TITLE;
59 replacements.push_back(secure_display::FormatUrlForSecurityDisplay( 59 replacements.push_back(url_formatter::FormatUrlForSecurityDisplay(
60 form_origin_url, std::string())); 60 form_origin_url, std::string()));
61 } 61 }
62 62
63 if (is_smartlock_branding_enabled) { 63 if (is_smartlock_branding_enabled) {
64 // "Google Smart Lock" should be a hyperlink. 64 // "Google Smart Lock" should be a hyperlink.
65 base::string16 title_link = 65 base::string16 title_link =
66 l10n_util::GetStringUTF16(IDS_PASSWORD_MANAGER_SMART_LOCK); 66 l10n_util::GetStringUTF16(IDS_PASSWORD_MANAGER_SMART_LOCK);
67 replacements.insert(replacements.begin(), title_link); 67 replacements.insert(replacements.begin(), title_link);
68 *title = l10n_util::GetStringFUTF16(title_id, replacements, &offsets); 68 *title = l10n_util::GetStringFUTF16(title_id, replacements, &offsets);
69 *title_link_range = 69 *title_link_range =
70 gfx::Range(offsets[0], offsets[0] + title_link.length()); 70 gfx::Range(offsets[0], offsets[0] + title_link.length());
71 } else { 71 } else {
72 replacements.insert( 72 replacements.insert(
73 replacements.begin(), 73 replacements.begin(),
74 l10n_util::GetStringUTF16(IDS_SAVE_PASSWORD_TITLE_BRAND)); 74 l10n_util::GetStringUTF16(IDS_SAVE_PASSWORD_TITLE_BRAND));
75 *title = l10n_util::GetStringFUTF16(title_id, replacements, &offsets); 75 *title = l10n_util::GetStringFUTF16(title_id, replacements, &offsets);
76 } 76 }
77 } 77 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698