Index: chrome/browser/ui/pdf/pdf_unsupported_feature.cc |
=================================================================== |
--- chrome/browser/ui/pdf/pdf_unsupported_feature.cc (revision 120576) |
+++ chrome/browser/ui/pdf/pdf_unsupported_feature.cc (working copy) |
@@ -13,7 +13,7 @@ |
#include "chrome/browser/plugin_prefs.h" |
#include "chrome/browser/prefs/pref_service.h" |
#include "chrome/browser/profiles/profile.h" |
-#include "chrome/browser/tab_contents/chrome_interstitial_page.h" |
+#include "chrome/browser/renderer_preferences_util.h" |
#include "chrome/browser/tab_contents/confirm_infobar_delegate.h" |
#include "chrome/browser/tab_contents/tab_util.h" |
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
@@ -21,6 +21,8 @@ |
#include "chrome/common/jstemplate_builder.h" |
#include "chrome/common/pref_names.h" |
#include "content/browser/renderer_host/render_view_host.h" |
+#include "content/browser/tab_contents/interstitial_page.h" |
+#include "content/public/browser/interstitial_page_delegate.h" |
#include "content/public/browser/plugin_service.h" |
#include "content/public/browser/render_process_host.h" |
#include "content/public/browser/user_metrics.h" |
@@ -162,21 +164,23 @@ |
// An interstitial to be used when the user chooses to open a PDF using Adobe |
// Reader, but it is out of date. |
-class PDFUnsupportedFeatureInterstitial : public ChromeInterstitialPage { |
+class PDFUnsupportedFeatureInterstitial |
+ : public content::InterstitialPageDelegate { |
public: |
PDFUnsupportedFeatureInterstitial( |
TabContentsWrapper* tab, |
const WebPluginInfo& reader_webplugininfo) |
- : ChromeInterstitialPage( |
- tab->web_contents(), false, tab->web_contents()->GetURL()), |
- tab_contents_(tab), |
+ : tab_contents_(tab), |
reader_webplugininfo_(reader_webplugininfo) { |
content::RecordAction(UserMetricsAction("PDF_ReaderInterstitialShown")); |
+ interstitial_page_ = InterstitialPage::Create( |
+ tab->web_contents(), false, tab->web_contents()->GetURL(), this); |
+ interstitial_page_->Show(); |
} |
protected: |
- // ChromeInterstitialPage implementation. |
- virtual std::string GetHTMLContents() { |
+ // InterstitialPageDelegate implementation. |
+ virtual std::string GetHTMLContents() OVERRIDE { |
DictionaryValue strings; |
strings.SetString( |
"title", |
@@ -204,18 +208,18 @@ |
return jstemplate_builder::GetI18nTemplateHtml(html, &strings); |
} |
- virtual void CommandReceived(const std::string& command) { |
+ virtual void CommandReceived(const std::string& command) OVERRIDE { |
if (command == "0") { |
content::RecordAction( |
UserMetricsAction("PDF_ReaderInterstitialCancel")); |
- DontProceed(); |
+ interstitial_page_->DontProceed(); |
return; |
} |
if (command == "1") { |
content::RecordAction( |
UserMetricsAction("PDF_ReaderInterstitialUpdate")); |
- OpenReaderUpdateURL(tab()); |
+ OpenReaderUpdateURL(tab_contents_->web_contents()); |
} else if (command == "2") { |
content::RecordAction( |
UserMetricsAction("PDF_ReaderInterstitialIgnore")); |
@@ -223,12 +227,19 @@ |
} else { |
NOTREACHED(); |
} |
- Proceed(); |
+ interstitial_page_->Proceed(); |
} |
+ virtual void OverrideRendererPrefs( |
+ content::RendererPreferences* prefs) OVERRIDE { |
+ renderer_preferences_util::UpdateFromSystemSettings( |
+ prefs, tab_contents_->profile()); |
+ } |
+ |
private: |
TabContentsWrapper* tab_contents_; |
WebPluginInfo reader_webplugininfo_; |
+ InterstitialPage* interstitial_page_; // Owns us. |
DISALLOW_COPY_AND_ASSIGN(PDFUnsupportedFeatureInterstitial); |
}; |
@@ -341,10 +352,7 @@ |
content::RecordAction(UserMetricsAction("PDF_UseReaderInfoBarOK")); |
if (reader_vulnerable_) { |
- PDFUnsupportedFeatureInterstitial* interstitial = |
- new PDFUnsupportedFeatureInterstitial(tab_contents_, |
- reader_webplugininfo_); |
- interstitial->Show(); |
+ new PDFUnsupportedFeatureInterstitial(tab_contents_, reader_webplugininfo_); |
return true; |
} |