OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/bad_clock_blocking_page.h" | 5 #include "chrome/browser/ssl/bad_clock_blocking_page.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/build_time.h" | 9 #include "base/build_time.h" |
10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 #include "content/public/browser/web_contents.h" | 42 #include "content/public/browser/web_contents.h" |
43 #include "content/public/common/renderer_preferences.h" | 43 #include "content/public/common/renderer_preferences.h" |
44 #include "content/public/common/ssl_status.h" | 44 #include "content/public/common/ssl_status.h" |
45 #include "grit/browser_resources.h" | 45 #include "grit/browser_resources.h" |
46 #include "grit/components_strings.h" | 46 #include "grit/components_strings.h" |
47 #include "net/base/net_errors.h" | 47 #include "net/base/net_errors.h" |
48 #include "net/base/net_util.h" | 48 #include "net/base/net_util.h" |
49 #include "net/cert/x509_certificate.h" | 49 #include "net/cert/x509_certificate.h" |
50 #include "ui/base/l10n/l10n_util.h" | 50 #include "ui/base/l10n/l10n_util.h" |
51 | 51 |
52 #if defined(OS_ANDROID) | 52 #if defined(ANDROID_JAVA_UI) |
53 #include "chrome/browser/android/intent_helper.h" | 53 #include "chrome/browser/android/intent_helper.h" |
54 #endif | 54 #endif |
55 | 55 |
56 #if defined(OS_CHROMEOS) | 56 #if defined(OS_CHROMEOS) |
57 #include "chrome/browser/profiles/profile_manager.h" | 57 #include "chrome/browser/profiles/profile_manager.h" |
58 #include "chrome/browser/ui/chrome_pages.h" | 58 #include "chrome/browser/ui/chrome_pages.h" |
59 #include "chrome/common/url_constants.h" | 59 #include "chrome/common/url_constants.h" |
60 #endif | 60 #endif |
61 | 61 |
62 #if defined(OS_WIN) | 62 #if defined(OS_WIN) |
(...skipping 11 matching lines...) Expand all Loading... |
74 using content::NavigationEntry; | 74 using content::NavigationEntry; |
75 | 75 |
76 namespace { | 76 namespace { |
77 | 77 |
78 const char kMetricsName[] = "bad_clock"; | 78 const char kMetricsName[] = "bad_clock"; |
79 | 79 |
80 void LaunchDateAndTimeSettings() { | 80 void LaunchDateAndTimeSettings() { |
81 DCHECK_CURRENTLY_ON(content::BrowserThread::FILE); | 81 DCHECK_CURRENTLY_ON(content::BrowserThread::FILE); |
82 // The code for each OS is completely separate, in order to avoid bugs like | 82 // The code for each OS is completely separate, in order to avoid bugs like |
83 // https://crbug.com/430877 . | 83 // https://crbug.com/430877 . |
84 #if defined(OS_ANDROID) | 84 #if defined(ANDROID_JAVA_UI) |
85 chrome::android::OpenDateAndTimeSettings(); | 85 chrome::android::OpenDateAndTimeSettings(); |
86 | |
87 #elif defined(OS_CHROMEOS) | 86 #elif defined(OS_CHROMEOS) |
88 std::string sub_page = | 87 std::string sub_page = |
89 std::string(chrome::kSearchSubPage) + "#" + | 88 std::string(chrome::kSearchSubPage) + "#" + |
90 l10n_util::GetStringUTF8(IDS_OPTIONS_SETTINGS_SECTION_TITLE_DATETIME); | 89 l10n_util::GetStringUTF8(IDS_OPTIONS_SETTINGS_SECTION_TITLE_DATETIME); |
91 chrome::ShowSettingsSubPageForProfile(ProfileManager::GetActiveUserProfile(), | 90 chrome::ShowSettingsSubPageForProfile(ProfileManager::GetActiveUserProfile(), |
92 sub_page); | 91 sub_page); |
93 | 92 |
94 #elif defined(OS_IOS) | 93 #elif defined(OS_IOS) |
95 // iOS does not have a way to launch the date and time settings. | 94 // iOS does not have a way to launch the date and time settings. |
96 NOTREACHED(); | 95 NOTREACHED(); |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 | 372 |
374 void BadClockBlockingPage::NotifyDenyCertificate() { | 373 void BadClockBlockingPage::NotifyDenyCertificate() { |
375 // It's possible that callback_ may not exist if the user clicks "Proceed" | 374 // It's possible that callback_ may not exist if the user clicks "Proceed" |
376 // followed by pressing the back button before the interstitial is hidden. | 375 // followed by pressing the back button before the interstitial is hidden. |
377 // In that case the certificate will still be treated as allowed. | 376 // In that case the certificate will still be treated as allowed. |
378 if (callback_.is_null()) | 377 if (callback_.is_null()) |
379 return; | 378 return; |
380 | 379 |
381 base::ResetAndReturn(&callback_).Run(false); | 380 base::ResetAndReturn(&callback_).Run(false); |
382 } | 381 } |
OLD | NEW |