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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 const content::LoadCommittedDetails& details) const { | 97 const content::LoadCommittedDetails& details) const { |
98 content::PageTransition transition = | 98 content::PageTransition transition = |
99 content::PageTransitionStripQualifier(details.entry->GetTransitionType()); | 99 content::PageTransitionStripQualifier(details.entry->GetTransitionType()); |
100 // We don't want to expire on a reload, because that is how we open the PDF in | 100 // We don't want to expire on a reload, because that is how we open the PDF in |
101 // Reader. | 101 // Reader. |
102 return !details.is_in_page && transition != content::PAGE_TRANSITION_RELOAD; | 102 return !details.is_in_page && transition != content::PAGE_TRANSITION_RELOAD; |
103 } | 103 } |
104 | 104 |
105 void PDFEnableAdobeReaderPromptDelegate::Accept() { | 105 void PDFEnableAdobeReaderPromptDelegate::Accept() { |
106 content::RecordAction(UserMetricsAction("PDF_EnableReaderInfoBarOK")); | 106 content::RecordAction(UserMetricsAction("PDF_EnableReaderInfoBarOK")); |
107 PluginPrefs* plugin_prefs = PluginPrefs::GetForProfile(profile_); | 107 PluginPrefs* plugin_prefs = PluginPrefs::GetForProfile(profile_).get(); |
108 plugin_prefs->EnablePluginGroup( | 108 plugin_prefs->EnablePluginGroup( |
109 true, ASCIIToUTF16(PluginMetadata::kAdobeReaderGroupName)); | 109 true, ASCIIToUTF16(PluginMetadata::kAdobeReaderGroupName)); |
110 plugin_prefs->EnablePluginGroup( | 110 plugin_prefs->EnablePluginGroup( |
111 false, ASCIIToUTF16(chrome::ChromeContentClient::kPDFPluginName)); | 111 false, ASCIIToUTF16(chrome::ChromeContentClient::kPDFPluginName)); |
112 } | 112 } |
113 | 113 |
114 void PDFEnableAdobeReaderPromptDelegate::Cancel() { | 114 void PDFEnableAdobeReaderPromptDelegate::Cancel() { |
115 content::RecordAction(UserMetricsAction("PDF_EnableReaderInfoBarCancel")); | 115 content::RecordAction(UserMetricsAction("PDF_EnableReaderInfoBarCancel")); |
116 } | 116 } |
117 | 117 |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 | 397 |
398 void PDFHasUnsupportedFeature(content::WebContents* web_contents) { | 398 void PDFHasUnsupportedFeature(content::WebContents* web_contents) { |
399 #if defined(OS_WIN) && defined(ENABLE_PLUGIN_INSTALLATION) | 399 #if defined(OS_WIN) && defined(ENABLE_PLUGIN_INSTALLATION) |
400 // Only works for Windows for now. For Mac, we'll have to launch the file | 400 // Only works for Windows for now. For Mac, we'll have to launch the file |
401 // externally since Adobe Reader doesn't work inside Chrome. | 401 // externally since Adobe Reader doesn't work inside Chrome. |
402 PluginService::GetInstance()->GetPlugins(base::Bind(&GotPluginsCallback, | 402 PluginService::GetInstance()->GetPlugins(base::Bind(&GotPluginsCallback, |
403 web_contents->GetRenderProcessHost()->GetID(), | 403 web_contents->GetRenderProcessHost()->GetID(), |
404 web_contents->GetRenderViewHost()->GetRoutingID())); | 404 web_contents->GetRenderViewHost()->GetRoutingID())); |
405 #endif | 405 #endif |
406 } | 406 } |
OLD | NEW |