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