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

Side by Side Diff: chrome/browser/ssl/ssl_blocking_page.cc

Issue 1002013008: Launch date+time settings on BrowserThread::FILE (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | no next file » | 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/ssl/ssl_blocking_page.h" 5 #include "chrome/browser/ssl/ssl_blocking_page.h"
6 6
7 #include "base/build_time.h" 7 #include "base/build_time.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/i18n/time_formatting.h" 10 #include "base/i18n/time_formatting.h"
(...skipping 10 matching lines...) Expand all
21 #include "chrome/browser/browser_process.h" 21 #include "chrome/browser/browser_process.h"
22 #include "chrome/browser/chrome_notification_types.h" 22 #include "chrome/browser/chrome_notification_types.h"
23 #include "chrome/browser/profiles/profile.h" 23 #include "chrome/browser/profiles/profile.h"
24 #include "chrome/browser/renderer_preferences_util.h" 24 #include "chrome/browser/renderer_preferences_util.h"
25 #include "chrome/browser/ssl/ssl_error_classification.h" 25 #include "chrome/browser/ssl/ssl_error_classification.h"
26 #include "chrome/browser/ssl/ssl_error_info.h" 26 #include "chrome/browser/ssl/ssl_error_info.h"
27 #include "chrome/common/chrome_switches.h" 27 #include "chrome/common/chrome_switches.h"
28 #include "chrome/grit/chromium_strings.h" 28 #include "chrome/grit/chromium_strings.h"
29 #include "chrome/grit/generated_resources.h" 29 #include "chrome/grit/generated_resources.h"
30 #include "components/google/core/browser/google_util.h" 30 #include "components/google/core/browser/google_util.h"
31 #include "content/public/browser/browser_thread.h"
31 #include "content/public/browser/cert_store.h" 32 #include "content/public/browser/cert_store.h"
32 #include "content/public/browser/interstitial_page.h" 33 #include "content/public/browser/interstitial_page.h"
33 #include "content/public/browser/interstitial_page_delegate.h" 34 #include "content/public/browser/interstitial_page_delegate.h"
34 #include "content/public/browser/navigation_controller.h" 35 #include "content/public/browser/navigation_controller.h"
35 #include "content/public/browser/navigation_entry.h" 36 #include "content/public/browser/navigation_entry.h"
36 #include "content/public/browser/notification_service.h" 37 #include "content/public/browser/notification_service.h"
37 #include "content/public/browser/notification_types.h" 38 #include "content/public/browser/notification_types.h"
38 #include "content/public/browser/render_process_host.h" 39 #include "content/public/browser/render_process_host.h"
39 #include "content/public/browser/render_view_host.h" 40 #include "content/public/browser/render_view_host.h"
40 #include "content/public/browser/web_contents.h" 41 #include "content/public/browser/web_contents.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 END_OF_SSL_EXPIRATION_AND_DECISION); 113 END_OF_SSL_EXPIRATION_AND_DECISION);
113 } else { 114 } else {
114 UMA_HISTOGRAM_ENUMERATION( 115 UMA_HISTOGRAM_ENUMERATION(
115 "interstitial.ssl.expiration_and_decision.nonoverridable", 116 "interstitial.ssl.expiration_and_decision.nonoverridable",
116 event, 117 event,
117 END_OF_SSL_EXPIRATION_AND_DECISION); 118 END_OF_SSL_EXPIRATION_AND_DECISION);
118 } 119 }
119 } 120 }
120 121
121 void LaunchDateAndTimeSettings() { 122 void LaunchDateAndTimeSettings() {
123 DCHECK_CURRENTLY_ON(content::BrowserThread::FILE);
122 // The code for each OS is completely separate, in order to avoid bugs like 124 // The code for each OS is completely separate, in order to avoid bugs like
123 // https://crbug.com/430877 . 125 // https://crbug.com/430877 .
124 #if defined(OS_ANDROID) 126 #if defined(OS_ANDROID)
125 chrome::android::OpenDateAndTimeSettings(); 127 chrome::android::OpenDateAndTimeSettings();
126 128
127 #elif defined(OS_CHROMEOS) 129 #elif defined(OS_CHROMEOS)
128 std::string sub_page = std::string(chrome::kSearchSubPage) + "#" + 130 std::string sub_page = std::string(chrome::kSearchSubPage) + "#" +
129 l10n_util::GetStringUTF8(IDS_OPTIONS_SETTINGS_SECTION_TITLE_DATETIME); 131 l10n_util::GetStringUTF8(IDS_OPTIONS_SETTINGS_SECTION_TITLE_DATETIME);
130 chrome::ShowSettingsSubPageForProfile( 132 chrome::ShowSettingsSubPageForProfile(
131 ProfileManager::GetActiveUserProfile(), sub_page); 133 ProfileManager::GetActiveUserProfile(), sub_page);
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 case CMD_RELOAD: { 487 case CMD_RELOAD: {
486 metrics_helper_->RecordUserInteraction( 488 metrics_helper_->RecordUserInteraction(
487 SecurityInterstitialMetricsHelper::RELOAD); 489 SecurityInterstitialMetricsHelper::RELOAD);
488 // The interstitial can't refresh itself. 490 // The interstitial can't refresh itself.
489 web_contents()->GetController().Reload(true); 491 web_contents()->GetController().Reload(true);
490 break; 492 break;
491 } 493 }
492 case CMD_OPEN_DATE_SETTINGS: { 494 case CMD_OPEN_DATE_SETTINGS: {
493 metrics_helper_->RecordUserInteraction( 495 metrics_helper_->RecordUserInteraction(
494 SecurityInterstitialMetricsHelper::OPEN_TIME_SETTINGS); 496 SecurityInterstitialMetricsHelper::OPEN_TIME_SETTINGS);
495 LaunchDateAndTimeSettings(); 497 content::BrowserThread::PostTask(content::BrowserThread::FILE, FROM_HERE,
498 base::Bind(&LaunchDateAndTimeSettings));
496 break; 499 break;
497 } 500 }
498 case CMD_OPEN_DIAGNOSTIC: 501 case CMD_OPEN_DIAGNOSTIC:
499 // Google doesn't currently have a transparency report for SSL. 502 // Google doesn't currently have a transparency report for SSL.
500 case CMD_DO_REPORT: 503 case CMD_DO_REPORT:
501 case CMD_DONT_REPORT: 504 case CMD_DONT_REPORT:
502 case CMD_OPEN_REPORTING_PRIVACY: 505 case CMD_OPEN_REPORTING_PRIVACY:
503 // Chrome doesn't currently do Extended Reporting for SSL. 506 // Chrome doesn't currently do Extended Reporting for SSL.
504 NOTREACHED() << "Unexpected command: " << command; 507 NOTREACHED() << "Unexpected command: " << command;
505 } 508 }
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 event_name.append(kEventNotOverridable); 573 event_name.append(kEventNotOverridable);
571 event_name.append(net::ErrorToString(cert_error_)); 574 event_name.append(net::ErrorToString(cert_error_));
572 return event_name; 575 return event_name;
573 } 576 }
574 577
575 // static 578 // static
576 bool SSLBlockingPage::IsOptionsOverridable(int options_mask) { 579 bool SSLBlockingPage::IsOptionsOverridable(int options_mask) {
577 return (options_mask & SSLBlockingPage::OVERRIDABLE) && 580 return (options_mask & SSLBlockingPage::OVERRIDABLE) &&
578 !(options_mask & SSLBlockingPage::STRICT_ENFORCEMENT); 581 !(options_mask & SSLBlockingPage::STRICT_ENFORCEMENT);
579 } 582 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698