OLD | NEW |
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" |
11 #include "base/metrics/field_trial.h" | 11 #include "base/metrics/field_trial.h" |
12 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
13 #include "base/process/launch.h" | 13 #include "base/process/launch.h" |
14 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
15 #include "base/strings/string_piece.h" | 15 #include "base/strings/string_piece.h" |
16 #include "base/strings/stringprintf.h" | 16 #include "base/strings/stringprintf.h" |
17 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
18 #include "base/time/time.h" | 18 #include "base/time/time.h" |
19 #include "base/values.h" | 19 #include "base/values.h" |
20 #include "chrome/browser/browser_process.h" | 20 #include "chrome/browser/browser_process.h" |
21 #include "chrome/browser/chrome_notification_types.h" | 21 #include "chrome/browser/chrome_notification_types.h" |
22 #include "chrome/browser/history/history_service_factory.h" | 22 #include "chrome/browser/history/history_service_factory.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/browser/ui/zoom/zoom_controller.h" |
27 #include "chrome/common/chrome_switches.h" | 28 #include "chrome/common/chrome_switches.h" |
28 #include "chrome/grit/chromium_strings.h" | 29 #include "chrome/grit/chromium_strings.h" |
29 #include "chrome/grit/generated_resources.h" | 30 #include "chrome/grit/generated_resources.h" |
30 #include "components/google/core/browser/google_util.h" | 31 #include "components/google/core/browser/google_util.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/navigation_controller.h" | 34 #include "content/public/browser/navigation_controller.h" |
34 #include "content/public/browser/navigation_entry.h" | 35 #include "content/public/browser/navigation_entry.h" |
35 #include "content/public/browser/notification_service.h" | 36 #include "content/public/browser/notification_service.h" |
36 #include "content/public/browser/notification_types.h" | 37 #include "content/public/browser/notification_types.h" |
37 #include "content/public/browser/render_process_host.h" | 38 #include "content/public/browser/render_process_host.h" |
38 #include "content/public/browser/render_view_host.h" | 39 #include "content/public/browser/render_view_host.h" |
39 #include "content/public/browser/web_contents.h" | 40 #include "content/public/browser/web_contents.h" |
| 41 #include "content/public/common/renderer_preferences.h" |
40 #include "content/public/common/ssl_status.h" | 42 #include "content/public/common/ssl_status.h" |
41 #include "grit/browser_resources.h" | 43 #include "grit/browser_resources.h" |
42 #include "net/base/hash_value.h" | 44 #include "net/base/hash_value.h" |
43 #include "net/base/net_errors.h" | 45 #include "net/base/net_errors.h" |
44 #include "net/base/net_util.h" | 46 #include "net/base/net_util.h" |
45 #include "ui/base/l10n/l10n_util.h" | 47 #include "ui/base/l10n/l10n_util.h" |
46 #include "ui/base/resource/resource_bundle.h" | 48 #include "ui/base/resource/resource_bundle.h" |
47 #include "ui/base/webui/jstemplate_builder.h" | 49 #include "ui/base/webui/jstemplate_builder.h" |
48 #include "ui/base/webui/web_ui_util.h" | 50 #include "ui/base/webui/web_ui_util.h" |
49 | 51 |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 NOTREACHED(); | 580 NOTREACHED(); |
579 } | 581 } |
580 } | 582 } |
581 } | 583 } |
582 | 584 |
583 void SSLBlockingPage::OverrideRendererPrefs( | 585 void SSLBlockingPage::OverrideRendererPrefs( |
584 content::RendererPreferences* prefs) { | 586 content::RendererPreferences* prefs) { |
585 Profile* profile = Profile::FromBrowserContext( | 587 Profile* profile = Profile::FromBrowserContext( |
586 web_contents_->GetBrowserContext()); | 588 web_contents_->GetBrowserContext()); |
587 renderer_preferences_util::UpdateFromSystemSettings(prefs, profile); | 589 renderer_preferences_util::UpdateFromSystemSettings(prefs, profile); |
| 590 prefs->default_zoom_level = |
| 591 ZoomController::FromWebContents(web_contents_)->GetDefaultZoomLevel(); |
588 } | 592 } |
589 | 593 |
590 void SSLBlockingPage::OnProceed() { | 594 void SSLBlockingPage::OnProceed() { |
591 RecordSSLBlockingPageDetailedStats(true, | 595 RecordSSLBlockingPageDetailedStats(true, |
592 cert_error_, | 596 cert_error_, |
593 overridable_, | 597 overridable_, |
594 internal_, | 598 internal_, |
595 num_visits_, | 599 num_visits_, |
596 expired_but_previously_allowed_); | 600 expired_but_previously_allowed_); |
597 #if defined(ENABLE_EXTENSIONS) | 601 #if defined(ENABLE_EXTENSIONS) |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 for (; i < 5; i++) { | 657 for (; i < 5; i++) { |
654 strings->SetString(keys[i], std::string()); | 658 strings->SetString(keys[i], std::string()); |
655 } | 659 } |
656 } | 660 } |
657 | 661 |
658 void SSLBlockingPage::OnGotHistoryCount(bool success, | 662 void SSLBlockingPage::OnGotHistoryCount(bool success, |
659 int num_visits, | 663 int num_visits, |
660 base::Time first_visit) { | 664 base::Time first_visit) { |
661 num_visits_ = num_visits; | 665 num_visits_ = num_visits; |
662 } | 666 } |
OLD | NEW |