| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/page_info/page_info.h" | 5 #include "chrome/browser/ui/page_info/page_info.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 } | 433 } |
| 434 web_contents()->OpenURL( | 434 web_contents()->OpenURL( |
| 435 content::OpenURLParams(GURL(link_destination), content::Referrer(), | 435 content::OpenURLParams(GURL(link_destination), content::Referrer(), |
| 436 WindowOpenDisposition::NEW_FOREGROUND_TAB, | 436 WindowOpenDisposition::NEW_FOREGROUND_TAB, |
| 437 ui::PAGE_TRANSITION_LINK, false)); | 437 ui::PAGE_TRANSITION_LINK, false)); |
| 438 RecordPageInfoAction(PageInfo::PAGE_INFO_SITE_SETTINGS_OPENED); | 438 RecordPageInfoAction(PageInfo::PAGE_INFO_SITE_SETTINGS_OPENED); |
| 439 } | 439 } |
| 440 | 440 |
| 441 void PageInfo::Init(const GURL& url, | 441 void PageInfo::Init(const GURL& url, |
| 442 const security_state::SecurityInfo& security_info) { | 442 const security_state::SecurityInfo& security_info) { |
| 443 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 443 #if !defined(OS_ANDROID) |
| 444 // On desktop, internal URLs aren't handled by this class. Instead, a | 444 // On desktop, internal URLs aren't handled by this class. Instead, a |
| 445 // custom and simpler bubble is shown. | 445 // custom and simpler bubble is shown. |
| 446 DCHECK(!url.SchemeIs(content::kChromeUIScheme) && | 446 DCHECK(!url.SchemeIs(content::kChromeUIScheme) && |
| 447 !url.SchemeIs(content::kChromeDevToolsScheme) && | 447 !url.SchemeIs(content::kChromeDevToolsScheme) && |
| 448 !url.SchemeIs(content::kViewSourceScheme) && | 448 !url.SchemeIs(content::kViewSourceScheme) && |
| 449 !url.SchemeIs(content_settings::kExtensionScheme)); | 449 !url.SchemeIs(content_settings::kExtensionScheme)); |
| 450 #endif | 450 #endif |
| 451 | 451 |
| 452 bool isChromeUINativeScheme = false; | 452 bool is_chrome_ui_native_scheme = false; |
| 453 #if defined(OS_ANDROID) | 453 #if defined(OS_ANDROID) |
| 454 isChromeUINativeScheme = url.SchemeIs(chrome::kChromeUINativeScheme); | 454 is_chrome_ui_native_scheme = url.SchemeIs(chrome::kChromeUINativeScheme); |
| 455 #endif | 455 #endif |
| 456 | 456 |
| 457 security_level_ = security_info.security_level; | 457 security_level_ = security_info.security_level; |
| 458 | 458 |
| 459 if (url.SchemeIs(url::kAboutScheme)) { | 459 if (url.SchemeIs(url::kAboutScheme)) { |
| 460 // All about: URLs except about:blank are redirected. | 460 // All about: URLs except about:blank are redirected. |
| 461 DCHECK_EQ(url::kAboutBlankURL, url.spec()); | 461 DCHECK_EQ(url::kAboutBlankURL, url.spec()); |
| 462 site_identity_status_ = SITE_IDENTITY_STATUS_NO_CERT; | 462 site_identity_status_ = SITE_IDENTITY_STATUS_NO_CERT; |
| 463 site_identity_details_ = | 463 site_identity_details_ = |
| 464 l10n_util::GetStringUTF16(IDS_PAGE_INFO_SECURITY_TAB_INSECURE_IDENTITY); | 464 l10n_util::GetStringUTF16(IDS_PAGE_INFO_SECURITY_TAB_INSECURE_IDENTITY); |
| 465 site_connection_status_ = SITE_CONNECTION_STATUS_UNENCRYPTED; | 465 site_connection_status_ = SITE_CONNECTION_STATUS_UNENCRYPTED; |
| 466 site_connection_details_ = l10n_util::GetStringFUTF16( | 466 site_connection_details_ = l10n_util::GetStringFUTF16( |
| 467 IDS_PAGE_INFO_SECURITY_TAB_NOT_ENCRYPTED_CONNECTION_TEXT, | 467 IDS_PAGE_INFO_SECURITY_TAB_NOT_ENCRYPTED_CONNECTION_TEXT, |
| 468 UTF8ToUTF16(url.spec())); | 468 UTF8ToUTF16(url.spec())); |
| 469 return; | 469 return; |
| 470 } | 470 } |
| 471 | 471 |
| 472 if (url.SchemeIs(content::kChromeUIScheme) || isChromeUINativeScheme) { | 472 if (url.SchemeIs(content::kChromeUIScheme) || is_chrome_ui_native_scheme) { |
| 473 site_identity_status_ = SITE_IDENTITY_STATUS_INTERNAL_PAGE; | 473 site_identity_status_ = SITE_IDENTITY_STATUS_INTERNAL_PAGE; |
| 474 site_identity_details_ = | 474 site_identity_details_ = |
| 475 l10n_util::GetStringUTF16(IDS_PAGE_INFO_INTERNAL_PAGE); | 475 l10n_util::GetStringUTF16(IDS_PAGE_INFO_INTERNAL_PAGE); |
| 476 site_connection_status_ = SITE_CONNECTION_STATUS_INTERNAL_PAGE; | 476 site_connection_status_ = SITE_CONNECTION_STATUS_INTERNAL_PAGE; |
| 477 return; | 477 return; |
| 478 } | 478 } |
| 479 | 479 |
| 480 // Identity section. | 480 // Identity section. |
| 481 certificate_ = security_info.certificate; | 481 certificate_ = security_info.certificate; |
| 482 | 482 |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 800 info.site_identity = UTF16ToUTF8(GetSimpleSiteName(site_url_)); | 800 info.site_identity = UTF16ToUTF8(GetSimpleSiteName(site_url_)); |
| 801 | 801 |
| 802 info.connection_status = site_connection_status_; | 802 info.connection_status = site_connection_status_; |
| 803 info.connection_status_description = UTF16ToUTF8(site_connection_details_); | 803 info.connection_status_description = UTF16ToUTF8(site_connection_details_); |
| 804 info.identity_status = site_identity_status_; | 804 info.identity_status = site_identity_status_; |
| 805 info.identity_status_description = UTF16ToUTF8(site_identity_details_); | 805 info.identity_status_description = UTF16ToUTF8(site_identity_details_); |
| 806 info.certificate = certificate_; | 806 info.certificate = certificate_; |
| 807 info.show_ssl_decision_revoke_button = show_ssl_decision_revoke_button_; | 807 info.show_ssl_decision_revoke_button = show_ssl_decision_revoke_button_; |
| 808 ui_->SetIdentityInfo(info); | 808 ui_->SetIdentityInfo(info); |
| 809 } | 809 } |
| OLD | NEW |