| 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 <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 | 90 |
| 91 PDFEnableAdobeReaderPromptClient::~PDFEnableAdobeReaderPromptClient() { | 91 PDFEnableAdobeReaderPromptClient::~PDFEnableAdobeReaderPromptClient() { |
| 92 } | 92 } |
| 93 | 93 |
| 94 bool PDFEnableAdobeReaderPromptClient::ShouldExpire( | 94 bool PDFEnableAdobeReaderPromptClient::ShouldExpire( |
| 95 const content::LoadCommittedDetails& details) const { | 95 const content::LoadCommittedDetails& details) const { |
| 96 ui::PageTransition transition = | 96 ui::PageTransition transition = |
| 97 ui::PageTransitionStripQualifier(details.entry->GetTransitionType()); | 97 ui::PageTransitionStripQualifier(details.entry->GetTransitionType()); |
| 98 // We don't want to expire on a reload, because that is how we open the PDF in | 98 // We don't want to expire on a reload, because that is how we open the PDF in |
| 99 // Reader. | 99 // Reader. |
| 100 return !details.is_in_page && transition != ui::PAGE_TRANSITION_RELOAD; | 100 return !details.is_in_page && |
| 101 !ui::PageTransitionCoreTypeIs(transition, ui::PAGE_TRANSITION_RELOAD); |
| 101 } | 102 } |
| 102 | 103 |
| 103 void PDFEnableAdobeReaderPromptClient::Accept() { | 104 void PDFEnableAdobeReaderPromptClient::Accept() { |
| 104 content::RecordAction(UserMetricsAction("PDF_EnableReaderInfoBarOK")); | 105 content::RecordAction(UserMetricsAction("PDF_EnableReaderInfoBarOK")); |
| 105 PluginPrefs* plugin_prefs = PluginPrefs::GetForProfile(profile_).get(); | 106 PluginPrefs* plugin_prefs = PluginPrefs::GetForProfile(profile_).get(); |
| 106 plugin_prefs->EnablePluginGroup( | 107 plugin_prefs->EnablePluginGroup( |
| 107 true, base::ASCIIToUTF16(PluginMetadata::kAdobeReaderGroupName)); | 108 true, base::ASCIIToUTF16(PluginMetadata::kAdobeReaderGroupName)); |
| 108 plugin_prefs->EnablePluginGroup( | 109 plugin_prefs->EnablePluginGroup( |
| 109 false, base::ASCIIToUTF16(ChromeContentClient::kPDFPluginName)); | 110 false, base::ASCIIToUTF16(ChromeContentClient::kPDFPluginName)); |
| 110 } | 111 } |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 MaybeShowOpenPDFInReaderPrompt(web_contents, reader_info); | 357 MaybeShowOpenPDFInReaderPrompt(web_contents, reader_info); |
| 357 return; | 358 return; |
| 358 } | 359 } |
| 359 GetAdobeReaderPluginInfoAsync( | 360 GetAdobeReaderPluginInfoAsync( |
| 360 profile, | 361 profile, |
| 361 base::Bind(&GotPluginsCallback, | 362 base::Bind(&GotPluginsCallback, |
| 362 web_contents->GetRenderProcessHost()->GetID(), | 363 web_contents->GetRenderProcessHost()->GetID(), |
| 363 web_contents->GetRenderViewHost()->GetRoutingID())); | 364 web_contents->GetRenderViewHost()->GetRoutingID())); |
| 364 #endif // defined(OS_WIN) | 365 #endif // defined(OS_WIN) |
| 365 } | 366 } |
| OLD | NEW |