Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(427)

Unified Diff: chrome/browser/ui/pdf/pdf_unsupported_feature.cc

Issue 477263003: pdf: Create a separate component for using the pdf pepper plugin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/pdf/pdf_unsupported_feature.cc
diff --git a/chrome/browser/ui/pdf/pdf_unsupported_feature.cc b/chrome/browser/ui/pdf/pdf_unsupported_feature.cc
index 4ae28c02320d0192f6cee52ec58306d1140a7a04..108bb18f990bba30afe56248e8b260ec0e809cfe 100644
--- a/chrome/browser/ui/pdf/pdf_unsupported_feature.cc
+++ b/chrome/browser/ui/pdf/pdf_unsupported_feature.cc
@@ -14,9 +14,9 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/renderer_preferences_util.h"
#include "chrome/browser/tab_contents/tab_util.h"
-#include "chrome/browser/ui/pdf/open_pdf_in_reader_prompt_delegate.h"
-#include "chrome/browser/ui/pdf/pdf_tab_helper.h"
#include "chrome/common/chrome_content_client.h"
+#include "components/pdf/browser/open_pdf_in_reader_prompt_delegate.h"
+#include "components/pdf/browser/pdf_tab_helper.h"
#include "content/public/browser/interstitial_page.h"
#include "content/public/browser/interstitial_page_delegate.h"
#include "content/public/browser/navigation_details.h"
@@ -53,12 +53,12 @@ const char kAdobeReaderUpdateUrl[] = "http://www.adobe.com/go/getreader_chrome";
// The prompt delegate used to ask the user if they want to use Adobe Reader
// by default.
class PDFEnableAdobeReaderPromptDelegate
- : public OpenPDFInReaderPromptDelegate {
+ : public pdf::OpenPDFInReaderPromptDelegate {
public:
explicit PDFEnableAdobeReaderPromptDelegate(Profile* profile);
virtual ~PDFEnableAdobeReaderPromptDelegate();
- // OpenPDFInReaderPromptDelegate
+ // pdf::OpenPDFInReaderPromptDelegate
virtual base::string16 GetMessageText() const OVERRIDE;
virtual base::string16 GetAcceptButtonText() const OVERRIDE;
virtual base::string16 GetCancelButtonText() const OVERRIDE;
@@ -130,7 +130,7 @@ void OpenReaderUpdateURL(WebContents* web_contents) {
// Opens the PDF using Adobe Reader.
void OpenUsingReader(WebContents* web_contents,
const WebPluginInfo& reader_plugin,
- OpenPDFInReaderPromptDelegate* delegate) {
+ pdf::OpenPDFInReaderPromptDelegate* delegate) {
ChromePluginServiceFilter::GetInstance()->OverridePluginForFrame(
web_contents->GetRenderProcessHost()->GetID(),
web_contents->GetMainFrame()->GetRoutingID(),
@@ -138,7 +138,8 @@ void OpenUsingReader(WebContents* web_contents,
reader_plugin);
web_contents->ReloadFocusedFrame(false);
- PDFTabHelper* pdf_tab_helper = PDFTabHelper::FromWebContents(web_contents);
+ pdf::PDFTabHelper* pdf_tab_helper =
+ pdf::PDFTabHelper::FromWebContents(web_contents);
if (delegate)
pdf_tab_helper->ShowOpenInReaderPrompt(make_scoped_ptr(delegate));
}
@@ -231,14 +232,14 @@ class PDFUnsupportedFeatureInterstitial
// The delegate for the bubble used to inform the user that we don't support a
// feature in the PDF.
class PDFUnsupportedFeaturePromptDelegate
- : public OpenPDFInReaderPromptDelegate {
+ : public pdf::OpenPDFInReaderPromptDelegate {
public:
PDFUnsupportedFeaturePromptDelegate(
WebContents* web_contents,
const AdobeReaderPluginInfo& reader_info);
virtual ~PDFUnsupportedFeaturePromptDelegate();
- // OpenPDFInReaderPromptDelegate:
+ // pdf::OpenPDFInReaderPromptDelegate:
virtual base::string16 GetMessageText() const OVERRIDE;
virtual base::string16 GetAcceptButtonText() const OVERRIDE;
virtual base::string16 GetCancelButtonText() const OVERRIDE;
@@ -313,7 +314,7 @@ void PDFUnsupportedFeaturePromptDelegate::Accept() {
Profile* profile =
Profile::FromBrowserContext(web_contents_->GetBrowserContext());
- OpenPDFInReaderPromptDelegate* delegate =
+ pdf::OpenPDFInReaderPromptDelegate* delegate =
new PDFEnableAdobeReaderPromptDelegate(profile);
OpenUsingReader(web_contents_, reader_info_.plugin_info, delegate);
@@ -331,9 +332,10 @@ void MaybeShowOpenPDFInReaderPrompt(WebContents* web_contents,
if (!reader_info.is_installed || !reader_info.is_enabled)
return;
- scoped_ptr<OpenPDFInReaderPromptDelegate> prompt(
+ scoped_ptr<pdf::OpenPDFInReaderPromptDelegate> prompt(
new PDFUnsupportedFeaturePromptDelegate(web_contents, reader_info));
- PDFTabHelper* pdf_tab_helper = PDFTabHelper::FromWebContents(web_contents);
+ pdf::PDFTabHelper* pdf_tab_helper =
+ pdf::PDFTabHelper::FromWebContents(web_contents);
pdf_tab_helper->ShowOpenInReaderPrompt(prompt.Pass());
}

Powered by Google App Engine
This is Rietveld 408576698