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/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "base/version.h" | 10 #include "base/version.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 #include "content/public/browser/interstitial_page_delegate.h" | 24 #include "content/public/browser/interstitial_page_delegate.h" |
25 #include "content/public/browser/plugin_service.h" | 25 #include "content/public/browser/plugin_service.h" |
26 #include "content/public/browser/render_process_host.h" | 26 #include "content/public/browser/render_process_host.h" |
27 #include "content/public/browser/render_view_host.h" | 27 #include "content/public/browser/render_view_host.h" |
28 #include "content/public/browser/user_metrics.h" | 28 #include "content/public/browser/user_metrics.h" |
29 #include "content/public/browser/web_contents.h" | 29 #include "content/public/browser/web_contents.h" |
30 #include "grit/browser_resources.h" | 30 #include "grit/browser_resources.h" |
31 #include "grit/generated_resources.h" | 31 #include "grit/generated_resources.h" |
32 #include "grit/theme_resources_standard.h" | 32 #include "grit/theme_resources_standard.h" |
33 #include "ui/base/l10n/l10n_util.h" | 33 #include "ui/base/l10n/l10n_util.h" |
| 34 #include "ui/base/layout.h" |
34 #include "ui/base/resource/resource_bundle.h" | 35 #include "ui/base/resource/resource_bundle.h" |
35 #include "ui/gfx/image/image.h" | 36 #include "ui/gfx/image/image.h" |
36 #include "webkit/plugins/npapi/plugin_group.h" | 37 #include "webkit/plugins/npapi/plugin_group.h" |
37 | 38 |
38 using content::InterstitialPage; | 39 using content::InterstitialPage; |
39 using content::OpenURLParams; | 40 using content::OpenURLParams; |
40 using content::PluginService; | 41 using content::PluginService; |
41 using content::Referrer; | 42 using content::Referrer; |
42 using content::UserMetricsAction; | 43 using content::UserMetricsAction; |
43 using content::WebContents; | 44 using content::WebContents; |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 l10n_util::GetStringUTF16( | 198 l10n_util::GetStringUTF16( |
198 IDS_READER_OUT_OF_DATE_BLOCKING_PAGE_PROCEED)); | 199 IDS_READER_OUT_OF_DATE_BLOCKING_PAGE_PROCEED)); |
199 strings.SetString( | 200 strings.SetString( |
200 "ok", | 201 "ok", |
201 l10n_util::GetStringUTF16(IDS_READER_OUT_OF_DATE_BLOCKING_PAGE_OK)); | 202 l10n_util::GetStringUTF16(IDS_READER_OUT_OF_DATE_BLOCKING_PAGE_OK)); |
202 strings.SetString( | 203 strings.SetString( |
203 "cancel", | 204 "cancel", |
204 l10n_util::GetStringUTF16(IDS_READER_OUT_OF_DATE_BLOCKING_PAGE_CANCEL)); | 205 l10n_util::GetStringUTF16(IDS_READER_OUT_OF_DATE_BLOCKING_PAGE_CANCEL)); |
205 | 206 |
206 base::StringPiece html(ResourceBundle::GetSharedInstance(). | 207 base::StringPiece html(ResourceBundle::GetSharedInstance(). |
207 GetRawDataResource(IDR_READER_OUT_OF_DATE_HTML)); | 208 GetRawDataResource(IDR_READER_OUT_OF_DATE_HTML, |
| 209 ui::SCALE_FACTOR_NONE)); |
208 | 210 |
209 return jstemplate_builder::GetI18nTemplateHtml(html, &strings); | 211 return jstemplate_builder::GetI18nTemplateHtml(html, &strings); |
210 } | 212 } |
211 | 213 |
212 virtual void CommandReceived(const std::string& command) OVERRIDE { | 214 virtual void CommandReceived(const std::string& command) OVERRIDE { |
213 if (command == "0") { | 215 if (command == "0") { |
214 content::RecordAction( | 216 content::RecordAction( |
215 UserMetricsAction("PDF_ReaderInterstitialCancel")); | 217 UserMetricsAction("PDF_ReaderInterstitialCancel")); |
216 interstitial_page_->DontProceed(); | 218 interstitial_page_->DontProceed(); |
217 return; | 219 return; |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 // Only works for Windows for now. For Mac, we'll have to launch the file | 418 // Only works for Windows for now. For Mac, we'll have to launch the file |
417 // externally since Adobe Reader doesn't work inside Chrome. | 419 // externally since Adobe Reader doesn't work inside Chrome. |
418 return; | 420 return; |
419 #endif | 421 #endif |
420 | 422 |
421 PluginService::GetInstance()->GetPluginGroups( | 423 PluginService::GetInstance()->GetPluginGroups( |
422 base::Bind(&GotPluginGroupsCallback, | 424 base::Bind(&GotPluginGroupsCallback, |
423 tab->web_contents()->GetRenderProcessHost()->GetID(), | 425 tab->web_contents()->GetRenderProcessHost()->GetID(), |
424 tab->web_contents()->GetRenderViewHost()->GetRoutingID())); | 426 tab->web_contents()->GetRenderViewHost()->GetRoutingID())); |
425 } | 427 } |
OLD | NEW |