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

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

Issue 10829452: Auto select the connection tab of the Website Settings UI in case of an https error or mixed content (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix build issues. Created 8 years, 3 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 | Annotate | Revision Log
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 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 site_connection_details_ += ASCIIToUTF16("\n\n"); 410 site_connection_details_ += ASCIIToUTF16("\n\n");
411 site_connection_details_ += l10n_util::GetStringUTF16( 411 site_connection_details_ += l10n_util::GetStringUTF16(
412 IDS_PAGE_INFO_SECURITY_TAB_FALLBACK_MESSAGE); 412 IDS_PAGE_INFO_SECURITY_TAB_FALLBACK_MESSAGE);
413 } 413 }
414 if (no_renegotiation) { 414 if (no_renegotiation) {
415 site_connection_details_ += ASCIIToUTF16("\n\n"); 415 site_connection_details_ += ASCIIToUTF16("\n\n");
416 site_connection_details_ += l10n_util::GetStringUTF16( 416 site_connection_details_ += l10n_util::GetStringUTF16(
417 IDS_PAGE_INFO_SECURITY_TAB_RENEGOTIATION_MESSAGE); 417 IDS_PAGE_INFO_SECURITY_TAB_RENEGOTIATION_MESSAGE);
418 } 418 }
419 } 419 }
420
421 // By default select the permissions tab that displays all the site
422 // permissions. In case of a connection error or an issue with the
423 // certificate presented by the website, select the connection tab to draw
424 // the user's attention to the issue. If the site does not provide a
425 // certificate because it was loaded over an unencrypted connection, don't
426 // select the connection tab.
427 WebsiteSettingsUI::TabId tab_id = WebsiteSettingsUI::TAB_ID_PERMISSIONS;
428 if (site_connection_status_ == SITE_CONNECTION_STATUS_ENCRYPTED_ERROR ||
429 site_connection_status_ == SITE_CONNECTION_STATUS_MIXED_CONTENT ||
430 site_identity_status_ == SITE_IDENTITY_STATUS_ERROR ||
431 site_identity_status_ == SITE_IDENTITY_STATUS_CERT_REVOCATION_UNKNOWN)
432 tab_id = WebsiteSettingsUI::TAB_ID_CONNECTION;
433 ui_->SetSelectedTab(tab_id);
420 } 434 }
421 435
422 void WebsiteSettings::PresentSitePermissions() { 436 void WebsiteSettings::PresentSitePermissions() {
423 PermissionInfoList permission_info_list; 437 PermissionInfoList permission_info_list;
424 438
425 WebsiteSettingsUI::PermissionInfo permission_info; 439 WebsiteSettingsUI::PermissionInfo permission_info;
426 for (size_t i = 0; i < arraysize(kPermissionType); ++i) { 440 for (size_t i = 0; i < arraysize(kPermissionType); ++i) {
427 permission_info.type = kPermissionType[i]; 441 permission_info.type = kPermissionType[i];
428 442
429 content_settings::SettingInfo info; 443 content_settings::SettingInfo info;
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 first_visit_text = l10n_util::GetStringFUTF16( 528 first_visit_text = l10n_util::GetStringFUTF16(
515 IDS_PAGE_INFO_SECURITY_TAB_VISITED_BEFORE_TODAY, 529 IDS_PAGE_INFO_SECURITY_TAB_VISITED_BEFORE_TODAY,
516 base::TimeFormatShortDate(first_visit)); 530 base::TimeFormatShortDate(first_visit));
517 } else { 531 } else {
518 first_visit_text = l10n_util::GetStringUTF16( 532 first_visit_text = l10n_util::GetStringUTF16(
519 IDS_PAGE_INFO_SECURITY_TAB_FIRST_VISITED_TODAY); 533 IDS_PAGE_INFO_SECURITY_TAB_FIRST_VISITED_TODAY);
520 534
521 } 535 }
522 ui_->SetFirstVisit(first_visit_text); 536 ui_->SetFirstVisit(first_visit_text);
523 } 537 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698