blob: ba6d562bd681ac298d41628f5b1595abe59c7c67 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/tab_contents/chrome_interstitial_page.h"
#include "chrome/browser/dom_operation_notification_details.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/renderer_preferences_util.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/render_messages.h"
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/tab_contents/tab_contents.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_source.h"
ChromeInterstitialPage::ChromeInterstitialPage(TabContents* tab,
bool new_navigation,
const GURL& url)
: InterstitialPage(tab, new_navigation, url) {
Profile* profile = Profile::FromBrowserContext(tab->GetBrowserContext());
content::RendererPreferences prefs;
renderer_preferences_util::UpdateFromSystemSettings(&prefs, profile);
set_renderer_preferences(prefs);
}
ChromeInterstitialPage::~ChromeInterstitialPage() {
}
void ChromeInterstitialPage::Show() {
InterstitialPage::Show();
notification_registrar_.Add(
this, chrome::NOTIFICATION_DOM_OPERATION_RESPONSE,
content::Source<RenderViewHost>(render_view_host()));
render_view_host()->Send(
new ChromeViewMsg_SetAsInterstitial(render_view_host()->routing_id()));
}
void ChromeInterstitialPage::Observe(
int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
if (chrome::NOTIFICATION_DOM_OPERATION_RESPONSE == type) {
if (enabled()) {
content::Details<DomOperationNotificationDetails> dom_op_details(details);
CommandReceived(dom_op_details->json());
}
return;
}
InterstitialPage::Observe(type, source, details);
}
|