| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/pdf_unsupported_feature.h" | 5 #include "chrome/browser/pdf_unsupported_feature.h" |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "base/version.h" | 9 #include "base/version.h" |
| 10 #include "chrome/browser/chrome_plugin_service_filter.h" | 10 #include "chrome/browser/chrome_plugin_service_filter.h" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 void OpenReaderUpdateURL(TabContents* tab) { | 133 void OpenReaderUpdateURL(TabContents* tab) { |
| 134 tab->OpenURL(GURL(kReaderUpdateUrl), GURL(), CURRENT_TAB, | 134 tab->OpenURL(GURL(kReaderUpdateUrl), GURL(), CURRENT_TAB, |
| 135 PageTransition::LINK); | 135 PageTransition::LINK); |
| 136 } | 136 } |
| 137 | 137 |
| 138 // Opens the PDF using Adobe Reader. | 138 // Opens the PDF using Adobe Reader. |
| 139 void OpenUsingReader(TabContentsWrapper* tab, | 139 void OpenUsingReader(TabContentsWrapper* tab, |
| 140 const WebPluginInfo& reader_plugin, | 140 const WebPluginInfo& reader_plugin, |
| 141 InfoBarDelegate* old_delegate, | 141 InfoBarDelegate* old_delegate, |
| 142 InfoBarDelegate* new_delegate) { | 142 InfoBarDelegate* new_delegate) { |
| 143 WebPluginInfo plugin = reader_plugin; | |
| 144 // Give the plugin a new version so that the renderer doesn't show the blocked | |
| 145 // plugin UI if it's vulnerable, since we already went through the | |
| 146 // interstitial. | |
| 147 plugin.version = ASCIIToUTF16("11.0.0.0"); | |
| 148 | |
| 149 ChromePluginServiceFilter::GetInstance()->OverridePluginForTab( | 143 ChromePluginServiceFilter::GetInstance()->OverridePluginForTab( |
| 150 tab->render_view_host()->process()->id(), | 144 tab->render_view_host()->process()->id(), |
| 151 tab->render_view_host()->routing_id(), | 145 tab->render_view_host()->routing_id(), |
| 152 tab->tab_contents()->GetURL(), | 146 tab->tab_contents()->GetURL(), |
| 153 plugin); | 147 ASCIIToUTF16(PluginGroup::kAdobeReaderGroupName)); |
| 154 tab->render_view_host()->ReloadFrame(); | 148 tab->render_view_host()->ReloadFrame(); |
| 155 | 149 |
| 156 if (new_delegate) { | 150 if (new_delegate) { |
| 157 if (old_delegate) { | 151 if (old_delegate) { |
| 158 tab->infobar_tab_helper()->ReplaceInfoBar(old_delegate, new_delegate); | 152 tab->infobar_tab_helper()->ReplaceInfoBar(old_delegate, new_delegate); |
| 159 } else { | 153 } else { |
| 160 tab->infobar_tab_helper()->AddInfoBar(new_delegate); | 154 tab->infobar_tab_helper()->AddInfoBar(new_delegate); |
| 161 } | 155 } |
| 162 } | 156 } |
| 163 } | 157 } |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 for (size_t i = 0; i < plugin_groups.size(); ++i) { | 385 for (size_t i = 0; i < plugin_groups.size(); ++i) { |
| 392 if (plugin_groups[i].GetGroupName() == reader_group_name) { | 386 if (plugin_groups[i].GetGroupName() == reader_group_name) { |
| 393 reader_group = &plugin_groups[i]; | 387 reader_group = &plugin_groups[i]; |
| 394 break; | 388 break; |
| 395 } | 389 } |
| 396 } | 390 } |
| 397 | 391 |
| 398 tab->infobar_tab_helper()->AddInfoBar( | 392 tab->infobar_tab_helper()->AddInfoBar( |
| 399 new PDFUnsupportedFeatureInfoBarDelegate(tab, reader_group)); | 393 new PDFUnsupportedFeatureInfoBarDelegate(tab, reader_group)); |
| 400 } | 394 } |
| OLD | NEW |