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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "base/version.h" | 10 #include "base/version.h" |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 tab->OpenURL(GURL(kReaderUpdateUrl), GURL(), NEW_FOREGROUND_TAB, | 129 tab->OpenURL(GURL(kReaderUpdateUrl), GURL(), NEW_FOREGROUND_TAB, |
130 content::PAGE_TRANSITION_LINK); | 130 content::PAGE_TRANSITION_LINK); |
131 } | 131 } |
132 | 132 |
133 // Opens the PDF using Adobe Reader. | 133 // Opens the PDF using Adobe Reader. |
134 void OpenUsingReader(TabContentsWrapper* tab, | 134 void OpenUsingReader(TabContentsWrapper* tab, |
135 const WebPluginInfo& reader_plugin, | 135 const WebPluginInfo& reader_plugin, |
136 InfoBarDelegate* old_delegate, | 136 InfoBarDelegate* old_delegate, |
137 InfoBarDelegate* new_delegate) { | 137 InfoBarDelegate* new_delegate) { |
138 ChromePluginServiceFilter::GetInstance()->OverridePluginForTab( | 138 ChromePluginServiceFilter::GetInstance()->OverridePluginForTab( |
139 tab->render_view_host()->process()->id(), | 139 tab->render_view_host()->process()->GetID(), |
140 tab->render_view_host()->routing_id(), | 140 tab->render_view_host()->routing_id(), |
141 tab->tab_contents()->GetURL(), | 141 tab->tab_contents()->GetURL(), |
142 ASCIIToUTF16(PluginGroup::kAdobeReaderGroupName)); | 142 ASCIIToUTF16(PluginGroup::kAdobeReaderGroupName)); |
143 tab->render_view_host()->ReloadFrame(); | 143 tab->render_view_host()->ReloadFrame(); |
144 | 144 |
145 if (new_delegate) { | 145 if (new_delegate) { |
146 if (old_delegate) { | 146 if (old_delegate) { |
147 tab->infobar_tab_helper()->ReplaceInfoBar(old_delegate, new_delegate); | 147 tab->infobar_tab_helper()->ReplaceInfoBar(old_delegate, new_delegate); |
148 } else { | 148 } else { |
149 tab->infobar_tab_helper()->AddInfoBar(new_delegate); | 149 tab->infobar_tab_helper()->AddInfoBar(new_delegate); |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 | 395 |
396 void PDFHasUnsupportedFeature(TabContentsWrapper* tab) { | 396 void PDFHasUnsupportedFeature(TabContentsWrapper* tab) { |
397 #if !defined(OS_WIN) | 397 #if !defined(OS_WIN) |
398 // Only works for Windows for now. For Mac, we'll have to launch the file | 398 // Only works for Windows for now. For Mac, we'll have to launch the file |
399 // externally since Adobe Reader doesn't work inside Chrome. | 399 // externally since Adobe Reader doesn't work inside Chrome. |
400 return; | 400 return; |
401 #endif | 401 #endif |
402 | 402 |
403 PluginService::GetInstance()->GetPluginGroups( | 403 PluginService::GetInstance()->GetPluginGroups( |
404 base::Bind(&GotPluginGroupsCallback, | 404 base::Bind(&GotPluginGroupsCallback, |
405 tab->render_view_host()->process()->id(), | 405 tab->render_view_host()->process()->GetID(), |
406 tab->render_view_host()->routing_id())); | 406 tab->render_view_host()->routing_id())); |
407 } | 407 } |
OLD | NEW |