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" |
(...skipping 11 matching lines...) Expand all Loading... |
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/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/cert_store.h" | 31 #include "content/public/browser/cert_store.h" |
| 32 #include "content/public/browser/host_zoom_map.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 // TODO(wjmaclean): Convert this to use the HostZoomMap for the WebContents |
| 591 // when HostZoomMap moves to StoragePartition. |
| 592 prefs->default_zoom_level = content::HostZoomMap::GetDefaultForBrowserContext( |
| 593 profile)->GetDefaultZoomLevel(); |
588 } | 594 } |
589 | 595 |
590 void SSLBlockingPage::OnProceed() { | 596 void SSLBlockingPage::OnProceed() { |
591 RecordSSLBlockingPageDetailedStats(true, | 597 RecordSSLBlockingPageDetailedStats(true, |
592 cert_error_, | 598 cert_error_, |
593 overridable_, | 599 overridable_, |
594 internal_, | 600 internal_, |
595 num_visits_, | 601 num_visits_, |
596 expired_but_previously_allowed_); | 602 expired_but_previously_allowed_); |
597 #if defined(ENABLE_EXTENSIONS) | 603 #if defined(ENABLE_EXTENSIONS) |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 for (; i < 5; i++) { | 659 for (; i < 5; i++) { |
654 strings->SetString(keys[i], std::string()); | 660 strings->SetString(keys[i], std::string()); |
655 } | 661 } |
656 } | 662 } |
657 | 663 |
658 void SSLBlockingPage::OnGotHistoryCount(bool success, | 664 void SSLBlockingPage::OnGotHistoryCount(bool success, |
659 int num_visits, | 665 int num_visits, |
660 base::Time first_visit) { | 666 base::Time first_visit) { |
661 num_visits_ = num_visits; | 667 num_visits_ = num_visits; |
662 } | 668 } |
OLD | NEW |