Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Side by Side Diff: chrome/browser/pdf_unsupported_feature.cc

Issue 7977042: Get rid of synchronous calls to getting plugins to help with http://codereview.chromium.org/79800... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/mock_plugin_exceptions_table_model.cc ('k') | chrome/browser/plugin_exceptions_table_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698