forked from sanyaade-mobiledev/chromium.src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adopt InterstitialPage to RenderViewHost message changes which were i…
…ntroduced by http://codereview.chromium.org/6883177. This makes the buttons on interstitial pages work again. Committed by sfeuz Review URL: http://codereview.chromium.org/6904159 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83880 0039d316-1c4b-4281-b951-d872f2087c98
- Loading branch information
markusheintz@chromium.org
committed
May 3, 2011
1 parent
2178814
commit ef1cef9
Showing
13 changed files
with
124 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// 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 "content/common/notification_service.h" | ||
#include "content/common/notification_source.h" | ||
|
||
ChromeInterstitialPage::ChromeInterstitialPage(TabContents* tab, | ||
bool new_navigation, | ||
const GURL& url) | ||
: InterstitialPage(tab, new_navigation, url) { | ||
} | ||
|
||
ChromeInterstitialPage::~ChromeInterstitialPage() { | ||
} | ||
|
||
void ChromeInterstitialPage::Show() { | ||
InterstitialPage::Show(); | ||
|
||
notification_registrar_.Add(this, NotificationType::DOM_OPERATION_RESPONSE, | ||
Source<RenderViewHost>(render_view_host())); | ||
} | ||
|
||
void ChromeInterstitialPage::Observe(NotificationType type, | ||
const NotificationSource& source, | ||
const NotificationDetails& details) { | ||
if (NotificationType::DOM_OPERATION_RESPONSE == type.value) { | ||
if (enabled()) { | ||
Details<DomOperationNotificationDetails> dom_op_details(details); | ||
CommandReceived(dom_op_details->json()); | ||
} | ||
return; | ||
} | ||
InterstitialPage::Observe(type, source, details); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// 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. | ||
|
||
#ifndef CHROME_BROWSER_TAB_CONTENTS_CHROME_INTERSTITIAL_PAGE_H_ | ||
#define CHROME_BROWSER_TAB_CONTENTS_CHROME_INTERSTITIAL_PAGE_H_ | ||
#pragma once | ||
|
||
#include <map> | ||
#include <string> | ||
|
||
#include "content/browser/tab_contents/interstitial_page.h" | ||
#include "content/common/notification_observer.h" | ||
#include "googleurl/src/gurl.h" | ||
|
||
class TabContents; | ||
|
||
// This class adds the possibility to react to DOMResponse-messages sent by | ||
// the RenderViewHost via ChromeRenderViewHostObserver to the InterstitialPage. | ||
class ChromeInterstitialPage : public InterstitialPage { | ||
public: | ||
ChromeInterstitialPage(TabContents* tab, | ||
bool new_navigation, | ||
const GURL& url); | ||
virtual ~ChromeInterstitialPage(); | ||
|
||
// Shows the interstitial page in the tab. | ||
virtual void Show(); | ||
|
||
protected: | ||
// NotificationObserver method: | ||
virtual void Observe(NotificationType type, | ||
const NotificationSource& source, | ||
const NotificationDetails& details); | ||
|
||
// Invoked when the page sent a command through DOMAutomation. | ||
virtual void CommandReceived(const std::string& command) {} | ||
|
||
private: | ||
DISALLOW_COPY_AND_ASSIGN(ChromeInterstitialPage); | ||
}; | ||
|
||
#endif // CHROME_BROWSER_TAB_CONTENTS_CHROME_INTERSTITIAL_PAGE_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.