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

Side by Side Diff: chrome/browser/ui/website_settings/website_settings.cc

Issue 1460983002: Expose GetLastCommitedOrigin() on WebContents and use it in about:blank (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | content/browser/web_contents/web_contents_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/website_settings/website_settings.h" 5 #include "chrome/browser/ui/website_settings/website_settings.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 const SecurityStateModel::SecurityInfo& security_info) { 353 const SecurityStateModel::SecurityInfo& security_info) {
354 bool isChromeUINativeScheme = false; 354 bool isChromeUINativeScheme = false;
355 #if defined(OS_ANDROID) 355 #if defined(OS_ANDROID)
356 isChromeUINativeScheme = url.SchemeIs(chrome::kChromeUINativeScheme); 356 isChromeUINativeScheme = url.SchemeIs(chrome::kChromeUINativeScheme);
357 #endif 357 #endif
358 358
359 if (url.SchemeIs(url::kAboutScheme)) { 359 if (url.SchemeIs(url::kAboutScheme)) {
360 // All about: URLs except about:blank are redirected. 360 // All about: URLs except about:blank are redirected.
361 DCHECK_EQ(url::kAboutBlankURL, url.spec()); 361 DCHECK_EQ(url::kAboutBlankURL, url.spec());
362 site_identity_status_ = SITE_IDENTITY_STATUS_NO_CERT; 362 site_identity_status_ = SITE_IDENTITY_STATUS_NO_CERT;
363 url::Origin origin = web_contents_->GetLastCommittedOrigin();
363 site_identity_details_ = 364 site_identity_details_ =
364 l10n_util::GetStringUTF16(IDS_PAGE_INFO_SECURITY_TAB_INSECURE_IDENTITY); 365 origin.unique() ? l10n_util::GetStringUTF16(
366 IDS_PAGE_INFO_SECURITY_TAB_INSECURE_IDENTITY)
367 : l10n_util::GetStringFUTF16(
368 IDS_PAGE_INFO_SECURITY_TAB_INHERITED_ORIGIN,
369 UTF8ToUTF16(origin.host()));
365 site_connection_status_ = SITE_CONNECTION_STATUS_UNENCRYPTED; 370 site_connection_status_ = SITE_CONNECTION_STATUS_UNENCRYPTED;
366 site_connection_details_ = l10n_util::GetStringFUTF16( 371 site_connection_details_ = l10n_util::GetStringFUTF16(
367 IDS_PAGE_INFO_SECURITY_TAB_NOT_ENCRYPTED_CONNECTION_TEXT, 372 IDS_PAGE_INFO_SECURITY_TAB_NOT_ENCRYPTED_CONNECTION_TEXT,
368 UTF8ToUTF16(url.spec())); 373 UTF8ToUTF16(url.spec()));
369 return; 374 return;
370 } 375 }
371 376
372 if (url.SchemeIs(content::kChromeUIScheme) || isChromeUINativeScheme) { 377 if (url.SchemeIs(content::kChromeUIScheme) || isChromeUINativeScheme) {
373 site_identity_status_ = SITE_IDENTITY_STATUS_INTERNAL_PAGE; 378 site_identity_status_ = SITE_IDENTITY_STATUS_INTERNAL_PAGE;
374 site_identity_details_ = 379 site_identity_details_ =
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
738 info.connection_status = site_connection_status_; 743 info.connection_status = site_connection_status_;
739 info.connection_status_description = 744 info.connection_status_description =
740 UTF16ToUTF8(site_connection_details_); 745 UTF16ToUTF8(site_connection_details_);
741 info.identity_status = site_identity_status_; 746 info.identity_status = site_identity_status_;
742 info.identity_status_description = 747 info.identity_status_description =
743 UTF16ToUTF8(site_identity_details_); 748 UTF16ToUTF8(site_identity_details_);
744 info.cert_id = cert_id_; 749 info.cert_id = cert_id_;
745 info.show_ssl_decision_revoke_button = show_ssl_decision_revoke_button_; 750 info.show_ssl_decision_revoke_button = show_ssl_decision_revoke_button_;
746 ui_->SetIdentityInfo(info); 751 ui_->SetIdentityInfo(info);
747 } 752 }
OLDNEW
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | content/browser/web_contents/web_contents_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698