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

Side by Side Diff: ios/chrome/browser/ui/dialogs/nsurl_protection_space_util.mm

Issue 2754383004: Rename WebsiteSettings code to PageInfo. (Closed)
Patch Set: Upload missing comment fix for WebSettingsUI -> PageInfoUI. Created 3 years, 9 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 #import "ios/chrome/browser/ui/dialogs/nsurl_protection_space_util.h" 5 #import "ios/chrome/browser/ui/dialogs/nsurl_protection_space_util.h"
6 6
7 #import "base/mac/scoped_nsobject.h" 7 #import "base/mac/scoped_nsobject.h"
8 #include "base/numerics/safe_conversions.h" 8 #include "base/numerics/safe_conversions.h"
9 #include "base/strings/sys_string_conversions.h" 9 #include "base/strings/sys_string_conversions.h"
10 #include "components/strings/grit/components_strings.h" 10 #include "components/strings/grit/components_strings.h"
11 #include "components/url_formatter/elide_url.h" 11 #include "components/url_formatter/elide_url.h"
12 #include "ui/base/l10n/l10n_util.h" 12 #include "ui/base/l10n/l10n_util.h"
13 #include "url/gurl.h" 13 #include "url/gurl.h"
14 #include "url/scheme_host_port.h" 14 #include "url/scheme_host_port.h"
15 15
16 namespace ios_internal { 16 namespace ios_internal {
17 namespace nsurlprotectionspace_util { 17 namespace nsurlprotectionspace_util {
18 18
19 NSString* MessageForHTTPAuth(NSURLProtectionSpace* protectionSpace) { 19 NSString* MessageForHTTPAuth(NSURLProtectionSpace* protectionSpace) {
20 DCHECK(CanShow(protectionSpace)); 20 DCHECK(CanShow(protectionSpace));
21 21
22 if (protectionSpace.receivesCredentialSecurely) 22 if (protectionSpace.receivesCredentialSecurely)
23 return RequesterIdentity(protectionSpace); 23 return RequesterIdentity(protectionSpace);
24 24
25 NSString* securityWarning = 25 NSString* securityWarning =
26 l10n_util::GetNSString(IDS_WEBSITE_SETTINGS_NON_SECURE_TRANSPORT); 26 l10n_util::GetNSString(IDS_PAGE_INFO_NON_SECURE_TRANSPORT);
27 return 27 return
28 [NSString stringWithFormat:@"%@ %@", RequesterIdentity(protectionSpace), 28 [NSString stringWithFormat:@"%@ %@", RequesterIdentity(protectionSpace),
29 securityWarning]; 29 securityWarning];
30 } 30 }
31 31
32 BOOL CanShow(NSURLProtectionSpace* protectionSpace) { 32 BOOL CanShow(NSURLProtectionSpace* protectionSpace) {
33 if (protectionSpace.host.length == 0) 33 if (protectionSpace.host.length == 0)
34 return NO; 34 return NO;
35 35
36 if (!base::IsValueInRangeForNumericType<uint16_t>(protectionSpace.port)) 36 if (!base::IsValueInRangeForNumericType<uint16_t>(protectionSpace.port))
(...skipping 23 matching lines...) Expand all
60 GURL RequesterOrigin(NSURLProtectionSpace* protectionSpace) { 60 GURL RequesterOrigin(NSURLProtectionSpace* protectionSpace) {
61 std::string scheme = base::SysNSStringToUTF8(protectionSpace.protocol); 61 std::string scheme = base::SysNSStringToUTF8(protectionSpace.protocol);
62 std::string host = base::SysNSStringToUTF8(protectionSpace.host); 62 std::string host = base::SysNSStringToUTF8(protectionSpace.host);
63 uint16_t port = base::checked_cast<uint16_t>(protectionSpace.port); 63 uint16_t port = base::checked_cast<uint16_t>(protectionSpace.port);
64 64
65 return GURL(url::SchemeHostPort(scheme, host, port).Serialize()); 65 return GURL(url::SchemeHostPort(scheme, host, port).Serialize());
66 } 66 }
67 67
68 } // namespace nsurlprotectionspace_util 68 } // namespace nsurlprotectionspace_util
69 } // namespace ios_internal 69 } // namespace ios_internal
OLDNEW
« no previous file with comments | « docs/ui/views/macviews_release.md ('k') | ios/chrome/browser/ui/dialogs/nsurl_protection_space_util_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698