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

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

Issue 620983002: Add Permissions to the PageInfo dialog on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@page_info_dialog_shell_only_v2
Patch Set: Made copy button close dialog, moved connection message into java, fixed way internal pages are det… Created 6 years, 2 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 (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/bind.h" 10 #include "base/bind.h"
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 void WebsiteSettings::OnRevokeSSLErrorBypassButtonPressed() { 330 void WebsiteSettings::OnRevokeSSLErrorBypassButtonPressed() {
331 DCHECK(chrome_ssl_host_state_delegate_); 331 DCHECK(chrome_ssl_host_state_delegate_);
332 chrome_ssl_host_state_delegate_->RevokeUserAllowExceptionsHard( 332 chrome_ssl_host_state_delegate_->RevokeUserAllowExceptionsHard(
333 site_url().host()); 333 site_url().host());
334 did_revoke_user_ssl_decisions_ = true; 334 did_revoke_user_ssl_decisions_ = true;
335 } 335 }
336 336
337 void WebsiteSettings::Init(Profile* profile, 337 void WebsiteSettings::Init(Profile* profile,
338 const GURL& url, 338 const GURL& url,
339 const content::SSLStatus& ssl) { 339 const content::SSLStatus& ssl) {
340 if (url.SchemeIs(content::kChromeUIScheme)) { 340 if (url.SchemeIs(content::kChromeUIScheme) ||
341 url.SchemeIs(url::kAboutScheme)) {
341 site_identity_status_ = SITE_IDENTITY_STATUS_INTERNAL_PAGE; 342 site_identity_status_ = SITE_IDENTITY_STATUS_INTERNAL_PAGE;
342 site_identity_details_ = 343 site_identity_details_ =
343 l10n_util::GetStringUTF16(IDS_PAGE_INFO_INTERNAL_PAGE); 344 l10n_util::GetStringUTF16(IDS_PAGE_INFO_INTERNAL_PAGE);
344 site_connection_status_ = SITE_CONNECTION_STATUS_INTERNAL_PAGE; 345 site_connection_status_ = SITE_CONNECTION_STATUS_INTERNAL_PAGE;
345 return; 346 return;
346 } 347 }
347 348
349 #if defined(OS_ANDROID)
350 if (url.SchemeIs(chrome::kChromeUINativeScheme)) {
Ted C 2014/10/16 21:30:45 I think it should be ok to ugly if def this in the
sashab 2014/10/17 00:51:27 Thought of a cool way to do this :) Done.
351 site_identity_status_ = SITE_IDENTITY_STATUS_INTERNAL_PAGE;
352 site_identity_details_ =
353 l10n_util::GetStringUTF16(IDS_PAGE_INFO_INTERNAL_PAGE);
354 site_connection_status_ = SITE_CONNECTION_STATUS_INTERNAL_PAGE;
355 return;
356 }
357 #endif
358
348 scoped_refptr<net::X509Certificate> cert; 359 scoped_refptr<net::X509Certificate> cert;
349 360
350 // Identity section. 361 // Identity section.
351 base::string16 subject_name(UTF8ToUTF16(url.host())); 362 base::string16 subject_name(UTF8ToUTF16(url.host()));
352 if (subject_name.empty()) { 363 if (subject_name.empty()) {
353 subject_name.assign( 364 subject_name.assign(
354 l10n_util::GetStringUTF16(IDS_PAGE_INFO_SECURITY_TAB_UNKNOWN_PARTY)); 365 l10n_util::GetStringUTF16(IDS_PAGE_INFO_SECURITY_TAB_UNKNOWN_PARTY));
355 } 366 }
356 367
357 cert_id_ = ssl.cert_id; 368 cert_id_ = ssl.cert_id;
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
762 if (visited_before_today) { 773 if (visited_before_today) {
763 first_visit_text = l10n_util::GetStringFUTF16( 774 first_visit_text = l10n_util::GetStringFUTF16(
764 IDS_PAGE_INFO_SECURITY_TAB_VISITED_BEFORE_TODAY, 775 IDS_PAGE_INFO_SECURITY_TAB_VISITED_BEFORE_TODAY,
765 base::TimeFormatShortDate(first_visit)); 776 base::TimeFormatShortDate(first_visit));
766 } else { 777 } else {
767 first_visit_text = l10n_util::GetStringUTF16( 778 first_visit_text = l10n_util::GetStringUTF16(
768 IDS_PAGE_INFO_SECURITY_TAB_FIRST_VISITED_TODAY); 779 IDS_PAGE_INFO_SECURITY_TAB_FIRST_VISITED_TODAY);
769 } 780 }
770 ui_->SetFirstVisit(first_visit_text); 781 ui_->SetFirstVisit(first_visit_text);
771 } 782 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698