| 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/plugin_updater.h" | 10 #include "chrome/browser/plugin_updater.h" |
| 11 #include "chrome/browser/prefs/pref_service.h" | 11 #include "chrome/browser/prefs/pref_service.h" |
| 12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
| 13 #include "chrome/browser/tab_contents/chrome_interstitial_page.h" | 13 #include "chrome/browser/tab_contents/chrome_interstitial_page.h" |
| 14 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" | 14 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" |
| 15 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 15 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 16 #include "chrome/common/chrome_content_client.h" | 16 #include "chrome/common/chrome_content_client.h" |
| 17 #include "chrome/common/jstemplate_builder.h" | 17 #include "chrome/common/jstemplate_builder.h" |
| 18 #include "chrome/common/pref_names.h" | 18 #include "chrome/common/pref_names.h" |
| 19 #include "content/browser/plugin_service.h" | 19 #include "content/browser/plugin_service.h" |
| 20 #include "content/browser/renderer_host/render_process_host.h" | 20 #include "content/browser/renderer_host/render_process_host.h" |
| 21 #include "content/browser/renderer_host/render_view_host.h" | 21 #include "content/browser/renderer_host/render_view_host.h" |
| 22 #include "content/browser/user_metrics.h" | 22 #include "content/browser/user_metrics.h" |
| 23 #include "content/common/view_messages.h" | 23 #include "content/common/view_messages.h" |
| 24 #include "grit/browser_resources.h" | 24 #include "grit/browser_resources.h" |
| 25 #include "grit/generated_resources.h" | 25 #include "grit/generated_resources.h" |
| 26 #include "ui/base/l10n/l10n_util.h" | 26 #include "ui/base/l10n/l10n_util.h" |
| 27 #include "ui/base/resource/resource_bundle.h" | 27 #include "ui/base/resource/resource_bundle.h" |
| 28 #include "webkit/plugins/npapi/plugin_group.h" | 28 #include "webkit/plugins/npapi/plugin_group.h" |
| 29 #include "webkit/plugins/npapi/plugin_list.h" | 29 #include "webkit/plugins/npapi/plugin_list.h" |
| 30 #include "webkit/plugins/npapi/webplugininfo.h" | 30 #include "webkit/plugins/webplugininfo.h" |
| 31 | 31 |
| 32 using webkit::npapi::PluginGroup; | 32 using webkit::npapi::PluginGroup; |
| 33 using webkit::npapi::PluginList; | 33 using webkit::npapi::PluginList; |
| 34 using webkit::npapi::WebPluginInfo; | 34 using webkit::WebPluginInfo; |
| 35 | 35 |
| 36 namespace { | 36 namespace { |
| 37 | 37 |
| 38 // Only launch Adobe Reader X or later. | 38 // Only launch Adobe Reader X or later. |
| 39 static const uint16 kMinReaderVersionToUse = 10; | 39 static const uint16 kMinReaderVersionToUse = 10; |
| 40 | 40 |
| 41 static const char kReaderUpdateUrl[] = | 41 static const char kReaderUpdateUrl[] = |
| 42 "http://www.adobe.com/go/getreader_chrome"; | 42 "http://www.adobe.com/go/getreader_chrome"; |
| 43 | 43 |
| 44 // The info bar delegate used to ask the user if they want to use Adobe Reader | 44 // The info bar delegate used to ask the user if they want to use Adobe Reader |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 false, &plugin_groups); | 381 false, &plugin_groups); |
| 382 for (size_t i = 0; i < plugin_groups.size(); ++i) { | 382 for (size_t i = 0; i < plugin_groups.size(); ++i) { |
| 383 if (plugin_groups[i].GetGroupName() == reader_group_name) { | 383 if (plugin_groups[i].GetGroupName() == reader_group_name) { |
| 384 reader_group = &plugin_groups[i]; | 384 reader_group = &plugin_groups[i]; |
| 385 break; | 385 break; |
| 386 } | 386 } |
| 387 } | 387 } |
| 388 | 388 |
| 389 tab->AddInfoBar(new PDFUnsupportedFeatureInfoBarDelegate(tab, reader_group)); | 389 tab->AddInfoBar(new PDFUnsupportedFeatureInfoBarDelegate(tab, reader_group)); |
| 390 } | 390 } |
| OLD | NEW |