OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/tab_contents/chrome_interstitial_page.h" | 5 #include "chrome/browser/tab_contents/chrome_interstitial_page.h" |
6 | 6 |
7 #include "chrome/browser/dom_operation_notification_details.h" | 7 #include "chrome/browser/dom_operation_notification_details.h" |
| 8 #include "chrome/browser/renderer_preferences_util.h" |
| 9 #include "content/browser/tab_contents/tab_contents.h" |
8 #include "content/common/notification_service.h" | 10 #include "content/common/notification_service.h" |
9 #include "content/common/notification_source.h" | 11 #include "content/common/notification_source.h" |
10 | 12 |
11 ChromeInterstitialPage::ChromeInterstitialPage(TabContents* tab, | 13 ChromeInterstitialPage::ChromeInterstitialPage(TabContents* tab, |
12 bool new_navigation, | 14 bool new_navigation, |
13 const GURL& url) | 15 const GURL& url) |
14 : InterstitialPage(tab, new_navigation, url) { | 16 : InterstitialPage(tab, new_navigation, url) { |
| 17 RendererPreferences prefs; |
| 18 renderer_preferences_util::UpdateFromSystemSettings( |
| 19 &prefs, tab->profile()); |
| 20 set_renderer_preferences(prefs); |
15 } | 21 } |
16 | 22 |
17 ChromeInterstitialPage::~ChromeInterstitialPage() { | 23 ChromeInterstitialPage::~ChromeInterstitialPage() { |
18 } | 24 } |
19 | 25 |
20 void ChromeInterstitialPage::Show() { | 26 void ChromeInterstitialPage::Show() { |
21 InterstitialPage::Show(); | 27 InterstitialPage::Show(); |
22 | 28 |
23 notification_registrar_.Add(this, NotificationType::DOM_OPERATION_RESPONSE, | 29 notification_registrar_.Add(this, NotificationType::DOM_OPERATION_RESPONSE, |
24 Source<RenderViewHost>(render_view_host())); | 30 Source<RenderViewHost>(render_view_host())); |
25 } | 31 } |
26 | 32 |
27 void ChromeInterstitialPage::Observe(NotificationType type, | 33 void ChromeInterstitialPage::Observe(NotificationType type, |
28 const NotificationSource& source, | 34 const NotificationSource& source, |
29 const NotificationDetails& details) { | 35 const NotificationDetails& details) { |
30 if (NotificationType::DOM_OPERATION_RESPONSE == type.value) { | 36 if (NotificationType::DOM_OPERATION_RESPONSE == type.value) { |
31 if (enabled()) { | 37 if (enabled()) { |
32 Details<DomOperationNotificationDetails> dom_op_details(details); | 38 Details<DomOperationNotificationDetails> dom_op_details(details); |
33 CommandReceived(dom_op_details->json()); | 39 CommandReceived(dom_op_details->json()); |
34 } | 40 } |
35 return; | 41 return; |
36 } | 42 } |
37 InterstitialPage::Observe(type, source, details); | 43 InterstitialPage::Observe(type, source, details); |
38 } | 44 } |
OLD | NEW |