| 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/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 // Reader. | 103 // Reader. |
| 104 return !details.is_in_page && transition != content::PAGE_TRANSITION_RELOAD; | 104 return !details.is_in_page && transition != content::PAGE_TRANSITION_RELOAD; |
| 105 } | 105 } |
| 106 | 106 |
| 107 void PDFEnableAdobeReaderPromptDelegate::Accept() { | 107 void PDFEnableAdobeReaderPromptDelegate::Accept() { |
| 108 content::RecordAction(UserMetricsAction("PDF_EnableReaderInfoBarOK")); | 108 content::RecordAction(UserMetricsAction("PDF_EnableReaderInfoBarOK")); |
| 109 PluginPrefs* plugin_prefs = PluginPrefs::GetForProfile(profile_).get(); | 109 PluginPrefs* plugin_prefs = PluginPrefs::GetForProfile(profile_).get(); |
| 110 plugin_prefs->EnablePluginGroup( | 110 plugin_prefs->EnablePluginGroup( |
| 111 true, ASCIIToUTF16(PluginMetadata::kAdobeReaderGroupName)); | 111 true, ASCIIToUTF16(PluginMetadata::kAdobeReaderGroupName)); |
| 112 plugin_prefs->EnablePluginGroup( | 112 plugin_prefs->EnablePluginGroup( |
| 113 false, ASCIIToUTF16(chrome::ChromeContentClient::kPDFPluginName)); | 113 false, ASCIIToUTF16(ChromeContentClient::kPDFPluginName)); |
| 114 } | 114 } |
| 115 | 115 |
| 116 void PDFEnableAdobeReaderPromptDelegate::Cancel() { | 116 void PDFEnableAdobeReaderPromptDelegate::Cancel() { |
| 117 content::RecordAction(UserMetricsAction("PDF_EnableReaderInfoBarCancel")); | 117 content::RecordAction(UserMetricsAction("PDF_EnableReaderInfoBarCancel")); |
| 118 } | 118 } |
| 119 | 119 |
| 120 string16 PDFEnableAdobeReaderPromptDelegate::GetAcceptButtonText() const { | 120 string16 PDFEnableAdobeReaderPromptDelegate::GetAcceptButtonText() const { |
| 121 return l10n_util::GetStringUTF16(IDS_PDF_INFOBAR_ALWAYS_USE_READER_BUTTON); | 121 return l10n_util::GetStringUTF16(IDS_PDF_INFOBAR_ALWAYS_USE_READER_BUTTON); |
| 122 } | 122 } |
| 123 | 123 |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 | 399 |
| 400 void PDFHasUnsupportedFeature(content::WebContents* web_contents) { | 400 void PDFHasUnsupportedFeature(content::WebContents* web_contents) { |
| 401 #if defined(OS_WIN) && defined(ENABLE_PLUGIN_INSTALLATION) | 401 #if defined(OS_WIN) && defined(ENABLE_PLUGIN_INSTALLATION) |
| 402 // Only works for Windows for now. For Mac, we'll have to launch the file | 402 // Only works for Windows for now. For Mac, we'll have to launch the file |
| 403 // externally since Adobe Reader doesn't work inside Chrome. | 403 // externally since Adobe Reader doesn't work inside Chrome. |
| 404 PluginService::GetInstance()->GetPlugins(base::Bind(&GotPluginsCallback, | 404 PluginService::GetInstance()->GetPlugins(base::Bind(&GotPluginsCallback, |
| 405 web_contents->GetRenderProcessHost()->GetID(), | 405 web_contents->GetRenderProcessHost()->GetID(), |
| 406 web_contents->GetRenderViewHost()->GetRoutingID())); | 406 web_contents->GetRenderViewHost()->GetRoutingID())); |
| 407 #endif | 407 #endif |
| 408 } | 408 } |
| OLD | NEW |