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 12 matching lines...) Expand all Loading... |
23 #include "content/browser/renderer_host/render_view_host.h" | 23 #include "content/browser/renderer_host/render_view_host.h" |
24 #include "content/browser/user_metrics.h" | 24 #include "content/browser/user_metrics.h" |
25 #include "content/common/view_messages.h" | 25 #include "content/common/view_messages.h" |
26 #include "grit/browser_resources.h" | 26 #include "grit/browser_resources.h" |
27 #include "grit/generated_resources.h" | 27 #include "grit/generated_resources.h" |
28 #include "grit/theme_resources_standard.h" | 28 #include "grit/theme_resources_standard.h" |
29 #include "ui/base/l10n/l10n_util.h" | 29 #include "ui/base/l10n/l10n_util.h" |
30 #include "ui/base/resource/resource_bundle.h" | 30 #include "ui/base/resource/resource_bundle.h" |
31 #include "ui/gfx/image/image.h" | 31 #include "ui/gfx/image/image.h" |
32 #include "webkit/plugins/npapi/plugin_group.h" | 32 #include "webkit/plugins/npapi/plugin_group.h" |
33 #include "webkit/plugins/npapi/plugin_list.h" | |
34 #include "webkit/plugins/webplugininfo.h" | |
35 | 33 |
36 using webkit::npapi::PluginGroup; | 34 using webkit::npapi::PluginGroup; |
37 using webkit::npapi::PluginList; | |
38 using webkit::WebPluginInfo; | 35 using webkit::WebPluginInfo; |
39 | 36 |
40 namespace { | 37 namespace { |
41 | 38 |
42 // Only launch Adobe Reader X or later. | 39 // Only launch Adobe Reader X or later. |
43 static const uint16 kMinReaderVersionToUse = 10; | 40 static const uint16 kMinReaderVersionToUse = 10; |
44 | 41 |
45 static const char kReaderUpdateUrl[] = | 42 static const char kReaderUpdateUrl[] = |
46 "http://www.adobe.com/go/getreader_chrome"; | 43 "http://www.adobe.com/go/getreader_chrome"; |
47 | 44 |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 | 377 |
381 // If the Reader plugin is disabled by policy, don't prompt them. | 378 // If the Reader plugin is disabled by policy, don't prompt them. |
382 PluginPrefs* plugin_prefs = PluginPrefs::GetForProfile(tab->profile()); | 379 PluginPrefs* plugin_prefs = PluginPrefs::GetForProfile(tab->profile()); |
383 if (plugin_prefs->PolicyStatusForPlugin(reader_group_name) == | 380 if (plugin_prefs->PolicyStatusForPlugin(reader_group_name) == |
384 PluginPrefs::POLICY_DISABLED) { | 381 PluginPrefs::POLICY_DISABLED) { |
385 return; | 382 return; |
386 } | 383 } |
387 | 384 |
388 PluginGroup* reader_group = NULL; | 385 PluginGroup* reader_group = NULL; |
389 std::vector<PluginGroup> plugin_groups; | 386 std::vector<PluginGroup> plugin_groups; |
390 PluginList::Singleton()->GetPluginGroups(false, &plugin_groups); | 387 PluginService::GetInstance()->GetCachedPluginGroups(&plugin_groups); |
391 for (size_t i = 0; i < plugin_groups.size(); ++i) { | 388 for (size_t i = 0; i < plugin_groups.size(); ++i) { |
392 if (plugin_groups[i].GetGroupName() == reader_group_name) { | 389 if (plugin_groups[i].GetGroupName() == reader_group_name) { |
393 reader_group = &plugin_groups[i]; | 390 reader_group = &plugin_groups[i]; |
394 break; | 391 break; |
395 } | 392 } |
396 } | 393 } |
397 | 394 |
398 tab->infobar_tab_helper()->AddInfoBar( | 395 tab->infobar_tab_helper()->AddInfoBar( |
399 new PDFUnsupportedFeatureInfoBarDelegate(tab, reader_group)); | 396 new PDFUnsupportedFeatureInfoBarDelegate(tab, reader_group)); |
400 } | 397 } |
OLD | NEW |