| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/plugins/plugin_infobar_delegates.h" | 5 #include "chrome/browser/plugins/plugin_infobar_delegates.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| 11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
| 12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 13 #include "chrome/app/vector_icons/vector_icons.h" |
| 13 #include "chrome/browser/infobars/infobar_service.h" | 14 #include "chrome/browser/infobars/infobar_service.h" |
| 14 #include "chrome/browser/lifetime/application_lifetime.h" | 15 #include "chrome/browser/lifetime/application_lifetime.h" |
| 15 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" | 16 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" |
| 16 #include "chrome/browser/plugins/plugin_metadata.h" | 17 #include "chrome/browser/plugins/plugin_metadata.h" |
| 17 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
| 18 #include "chrome/browser/shell_integration.h" | 19 #include "chrome/browser/shell_integration.h" |
| 19 #include "chrome/browser/ui/browser_commands.h" | 20 #include "chrome/browser/ui/browser_commands.h" |
| 20 #include "chrome/common/features.h" | 21 #include "chrome/common/features.h" |
| 21 #include "chrome/common/url_constants.h" | 22 #include "chrome/common/url_constants.h" |
| 22 #include "chrome/grit/chromium_strings.h" | 23 #include "chrome/grit/chromium_strings.h" |
| 23 #include "chrome/grit/generated_resources.h" | 24 #include "chrome/grit/generated_resources.h" |
| 24 #include "chrome/grit/locale_settings.h" | 25 #include "chrome/grit/locale_settings.h" |
| 25 #include "chrome/grit/theme_resources.h" | 26 #include "chrome/grit/theme_resources.h" |
| 26 #include "components/google/core/browser/google_util.h" | 27 #include "components/google/core/browser/google_util.h" |
| 27 #include "components/infobars/core/infobar.h" | 28 #include "components/infobars/core/infobar.h" |
| 28 #include "components/strings/grit/components_strings.h" | 29 #include "components/strings/grit/components_strings.h" |
| 29 #include "content/public/browser/render_process_host.h" | 30 #include "content/public/browser/render_process_host.h" |
| 30 #include "content/public/browser/render_view_host.h" | 31 #include "content/public/browser/render_view_host.h" |
| 31 #include "content/public/browser/user_metrics.h" | 32 #include "content/public/browser/user_metrics.h" |
| 32 #include "content/public/browser/web_contents.h" | 33 #include "content/public/browser/web_contents.h" |
| 33 #include "ui/base/l10n/l10n_util.h" | 34 #include "ui/base/l10n/l10n_util.h" |
| 34 #include "ui/gfx/vector_icons_public.h" | |
| 35 | 35 |
| 36 #if BUILDFLAG(ENABLE_PLUGIN_INSTALLATION) | 36 #if BUILDFLAG(ENABLE_PLUGIN_INSTALLATION) |
| 37 #include "chrome/browser/plugins/plugin_installer.h" | 37 #include "chrome/browser/plugins/plugin_installer.h" |
| 38 #endif | 38 #endif |
| 39 | 39 |
| 40 #if defined(OS_WIN) | 40 #if defined(OS_WIN) |
| 41 #include <shellapi.h> | 41 #include <shellapi.h> |
| 42 #include "ui/base/win/shell.h" | 42 #include "ui/base/win/shell.h" |
| 43 #endif | 43 #endif |
| 44 | 44 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 | 103 |
| 104 infobars::InfoBarDelegate::InfoBarIdentifier | 104 infobars::InfoBarDelegate::InfoBarIdentifier |
| 105 OutdatedPluginInfoBarDelegate::GetIdentifier() const { | 105 OutdatedPluginInfoBarDelegate::GetIdentifier() const { |
| 106 return OUTDATED_PLUGIN_INFOBAR_DELEGATE; | 106 return OUTDATED_PLUGIN_INFOBAR_DELEGATE; |
| 107 } | 107 } |
| 108 | 108 |
| 109 void OutdatedPluginInfoBarDelegate::InfoBarDismissed() { | 109 void OutdatedPluginInfoBarDelegate::InfoBarDismissed() { |
| 110 content::RecordAction(UserMetricsAction("OutdatedPluginInfobar.Dismissed")); | 110 content::RecordAction(UserMetricsAction("OutdatedPluginInfobar.Dismissed")); |
| 111 } | 111 } |
| 112 | 112 |
| 113 gfx::VectorIconId OutdatedPluginInfoBarDelegate::GetVectorIconId() const { | 113 const gfx::VectorIcon& OutdatedPluginInfoBarDelegate::GetVectorIcon() const { |
| 114 return gfx::VectorIconId::EXTENSION; | 114 return kExtensionIcon; |
| 115 } | 115 } |
| 116 | 116 |
| 117 base::string16 OutdatedPluginInfoBarDelegate::GetMessageText() const { | 117 base::string16 OutdatedPluginInfoBarDelegate::GetMessageText() const { |
| 118 return message_; | 118 return message_; |
| 119 } | 119 } |
| 120 | 120 |
| 121 base::string16 OutdatedPluginInfoBarDelegate::GetButtonLabel( | 121 base::string16 OutdatedPluginInfoBarDelegate::GetButtonLabel( |
| 122 InfoBarButton button) const { | 122 InfoBarButton button) const { |
| 123 return l10n_util::GetStringUTF16((button == BUTTON_OK) ? | 123 return l10n_util::GetStringUTF16((button == BUTTON_OK) ? |
| 124 IDS_PLUGIN_UPDATE : IDS_PLUGIN_ENABLE_TEMPORARILY); | 124 IDS_PLUGIN_UPDATE : IDS_PLUGIN_ENABLE_TEMPORARILY); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 const base::string16& message) { | 206 const base::string16& message) { |
| 207 DCHECK(infobar->owner()); | 207 DCHECK(infobar->owner()); |
| 208 infobar->owner()->ReplaceInfoBar( | 208 infobar->owner()->ReplaceInfoBar( |
| 209 infobar, infobar->owner()->CreateConfirmInfoBar( | 209 infobar, infobar->owner()->CreateConfirmInfoBar( |
| 210 std::unique_ptr<ConfirmInfoBarDelegate>( | 210 std::unique_ptr<ConfirmInfoBarDelegate>( |
| 211 new OutdatedPluginInfoBarDelegate( | 211 new OutdatedPluginInfoBarDelegate( |
| 212 installer, std::move(plugin_metadata), message)))); | 212 installer, std::move(plugin_metadata), message)))); |
| 213 } | 213 } |
| 214 | 214 |
| 215 #endif // BUILDFLAG(ENABLE_PLUGIN_INSTALLATION) | 215 #endif // BUILDFLAG(ENABLE_PLUGIN_INSTALLATION) |
| OLD | NEW |