| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/pdf/pdf_unsupported_feature.h" | 5 #include "chrome/browser/ui/pdf/pdf_unsupported_feature.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/lifetime/application_lifetime.h" | 10 #include "chrome/browser/lifetime/application_lifetime.h" |
| 11 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" | 11 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" |
| 12 #include "chrome/browser/plugins/plugin_metadata.h" | 12 #include "chrome/browser/plugins/plugin_metadata.h" |
| 13 #include "chrome/browser/plugins/plugin_prefs.h" | 13 #include "chrome/browser/plugins/plugin_prefs.h" |
| 14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 15 #include "chrome/browser/renderer_preferences_util.h" | 15 #include "chrome/browser/renderer_preferences_util.h" |
| 16 #include "chrome/browser/tab_contents/tab_util.h" | 16 #include "chrome/browser/tab_contents/tab_util.h" |
| 17 #include "chrome/browser/ui/zoom/zoom_controller.h" |
| 17 #include "chrome/common/chrome_content_client.h" | 18 #include "chrome/common/chrome_content_client.h" |
| 18 #include "chrome/grit/generated_resources.h" | 19 #include "chrome/grit/generated_resources.h" |
| 19 #include "components/pdf/browser/open_pdf_in_reader_prompt_client.h" | 20 #include "components/pdf/browser/open_pdf_in_reader_prompt_client.h" |
| 20 #include "components/pdf/browser/pdf_web_contents_helper.h" | 21 #include "components/pdf/browser/pdf_web_contents_helper.h" |
| 21 #include "content/public/browser/interstitial_page.h" | 22 #include "content/public/browser/interstitial_page.h" |
| 22 #include "content/public/browser/interstitial_page_delegate.h" | 23 #include "content/public/browser/interstitial_page_delegate.h" |
| 23 #include "content/public/browser/navigation_details.h" | 24 #include "content/public/browser/navigation_details.h" |
| 24 #include "content/public/browser/navigation_entry.h" | 25 #include "content/public/browser/navigation_entry.h" |
| 25 #include "content/public/browser/page_navigator.h" | 26 #include "content/public/browser/page_navigator.h" |
| 26 #include "content/public/browser/render_frame_host.h" | 27 #include "content/public/browser/render_frame_host.h" |
| 27 #include "content/public/browser/render_process_host.h" | 28 #include "content/public/browser/render_process_host.h" |
| 28 #include "content/public/browser/render_view_host.h" | 29 #include "content/public/browser/render_view_host.h" |
| 29 #include "content/public/browser/user_metrics.h" | 30 #include "content/public/browser/user_metrics.h" |
| 30 #include "content/public/browser/web_contents.h" | 31 #include "content/public/browser/web_contents.h" |
| 32 #include "content/public/common/renderer_preferences.h" |
| 31 #include "grit/browser_resources.h" | 33 #include "grit/browser_resources.h" |
| 32 #include "ui/base/l10n/l10n_util.h" | 34 #include "ui/base/l10n/l10n_util.h" |
| 33 #include "ui/base/resource/resource_bundle.h" | 35 #include "ui/base/resource/resource_bundle.h" |
| 34 #include "ui/base/webui/jstemplate_builder.h" | 36 #include "ui/base/webui/jstemplate_builder.h" |
| 35 | 37 |
| 36 #if defined(OS_WIN) | 38 #if defined(OS_WIN) |
| 37 #include "base/win/metro.h" | 39 #include "base/win/metro.h" |
| 38 #include "chrome/browser/ui/pdf/adobe_reader_info_win.h" | 40 #include "chrome/browser/ui/pdf/adobe_reader_info_win.h" |
| 39 #endif | 41 #endif |
| 40 | 42 |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 } else { | 213 } else { |
| 212 NOTREACHED(); | 214 NOTREACHED(); |
| 213 } | 215 } |
| 214 interstitial_page_->Proceed(); | 216 interstitial_page_->Proceed(); |
| 215 } | 217 } |
| 216 | 218 |
| 217 virtual void OverrideRendererPrefs( | 219 virtual void OverrideRendererPrefs( |
| 218 content::RendererPreferences* prefs) OVERRIDE { | 220 content::RendererPreferences* prefs) OVERRIDE { |
| 219 Profile* profile = | 221 Profile* profile = |
| 220 Profile::FromBrowserContext(web_contents_->GetBrowserContext()); | 222 Profile::FromBrowserContext(web_contents_->GetBrowserContext()); |
| 221 renderer_preferences_util::UpdateFromSystemSettings(prefs, profile); | 223 renderer_preferences_util::UpdateFromSystemSettings( |
| 224 prefs, profile, web_contents_); |
| 222 } | 225 } |
| 223 | 226 |
| 224 private: | 227 private: |
| 225 WebContents* web_contents_; | 228 WebContents* web_contents_; |
| 226 WebPluginInfo reader_webplugininfo_; | 229 WebPluginInfo reader_webplugininfo_; |
| 227 InterstitialPage* interstitial_page_; // Owns us. | 230 InterstitialPage* interstitial_page_; // Owns us. |
| 228 | 231 |
| 229 DISALLOW_COPY_AND_ASSIGN(PDFUnsupportedFeatureInterstitial); | 232 DISALLOW_COPY_AND_ASSIGN(PDFUnsupportedFeatureInterstitial); |
| 230 }; | 233 }; |
| 231 | 234 |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 MaybeShowOpenPDFInReaderPrompt(web_contents, reader_info); | 361 MaybeShowOpenPDFInReaderPrompt(web_contents, reader_info); |
| 359 return; | 362 return; |
| 360 } | 363 } |
| 361 GetAdobeReaderPluginInfoAsync( | 364 GetAdobeReaderPluginInfoAsync( |
| 362 profile, | 365 profile, |
| 363 base::Bind(&GotPluginsCallback, | 366 base::Bind(&GotPluginsCallback, |
| 364 web_contents->GetRenderProcessHost()->GetID(), | 367 web_contents->GetRenderProcessHost()->GetID(), |
| 365 web_contents->GetRenderViewHost()->GetRoutingID())); | 368 web_contents->GetRenderViewHost()->GetRoutingID())); |
| 366 #endif // defined(OS_WIN) | 369 #endif // defined(OS_WIN) |
| 367 } | 370 } |
| OLD | NEW |