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/browser/infobars/infobar_service.h" | 13 #include "chrome/browser/infobars/infobar_service.h" |
14 #include "chrome/browser/lifetime/application_lifetime.h" | 14 #include "chrome/browser/lifetime/application_lifetime.h" |
15 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" | 15 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" |
16 #include "chrome/browser/plugins/plugin_metadata.h" | 16 #include "chrome/browser/plugins/plugin_metadata.h" |
17 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
18 #include "chrome/browser/shell_integration.h" | 18 #include "chrome/browser/shell_integration.h" |
19 #include "chrome/browser/ui/browser_commands.h" | 19 #include "chrome/browser/ui/browser_commands.h" |
| 20 #include "chrome/common/features.h" |
20 #include "chrome/common/url_constants.h" | 21 #include "chrome/common/url_constants.h" |
21 #include "chrome/grit/chromium_strings.h" | 22 #include "chrome/grit/chromium_strings.h" |
22 #include "chrome/grit/generated_resources.h" | 23 #include "chrome/grit/generated_resources.h" |
23 #include "chrome/grit/locale_settings.h" | 24 #include "chrome/grit/locale_settings.h" |
24 #include "chrome/grit/theme_resources.h" | 25 #include "chrome/grit/theme_resources.h" |
25 #include "components/google/core/browser/google_util.h" | 26 #include "components/google/core/browser/google_util.h" |
26 #include "components/infobars/core/infobar.h" | 27 #include "components/infobars/core/infobar.h" |
27 #include "components/strings/grit/components_strings.h" | 28 #include "components/strings/grit/components_strings.h" |
28 #include "content/public/browser/render_process_host.h" | 29 #include "content/public/browser/render_process_host.h" |
29 #include "content/public/browser/render_view_host.h" | 30 #include "content/public/browser/render_view_host.h" |
30 #include "content/public/browser/user_metrics.h" | 31 #include "content/public/browser/user_metrics.h" |
31 #include "content/public/browser/web_contents.h" | 32 #include "content/public/browser/web_contents.h" |
32 #include "ui/base/l10n/l10n_util.h" | 33 #include "ui/base/l10n/l10n_util.h" |
33 #include "ui/gfx/vector_icons_public.h" | 34 #include "ui/gfx/vector_icons_public.h" |
34 | 35 |
35 #if defined(ENABLE_PLUGIN_INSTALLATION) | 36 #if BUILDFLAG(ENABLE_PLUGIN_INSTALLATION) |
36 #include "chrome/browser/plugins/plugin_installer.h" | 37 #include "chrome/browser/plugins/plugin_installer.h" |
37 #endif | 38 #endif |
38 | 39 |
39 #if defined(OS_WIN) | 40 #if defined(OS_WIN) |
40 #include <shellapi.h> | 41 #include <shellapi.h> |
41 #include "ui/base/win/shell.h" | 42 #include "ui/base/win/shell.h" |
42 #endif | 43 #endif |
43 | 44 |
44 using base::UserMetricsAction; | 45 using base::UserMetricsAction; |
45 | 46 |
46 #if defined(ENABLE_PLUGIN_INSTALLATION) | 47 #if BUILDFLAG(ENABLE_PLUGIN_INSTALLATION) |
47 | 48 |
48 // OutdatedPluginInfoBarDelegate ---------------------------------------------- | 49 // OutdatedPluginInfoBarDelegate ---------------------------------------------- |
49 | 50 |
50 void OutdatedPluginInfoBarDelegate::Create( | 51 void OutdatedPluginInfoBarDelegate::Create( |
51 InfoBarService* infobar_service, | 52 InfoBarService* infobar_service, |
52 PluginInstaller* installer, | 53 PluginInstaller* installer, |
53 std::unique_ptr<PluginMetadata> plugin_metadata) { | 54 std::unique_ptr<PluginMetadata> plugin_metadata) { |
54 // Copy the name out of |plugin_metadata| now, since the Pass() call below | 55 // Copy the name out of |plugin_metadata| now, since the Pass() call below |
55 // will make it impossible to get at. | 56 // will make it impossible to get at. |
56 base::string16 name(plugin_metadata->name()); | 57 base::string16 name(plugin_metadata->name()); |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 std::unique_ptr<PluginMetadata> plugin_metadata, | 205 std::unique_ptr<PluginMetadata> plugin_metadata, |
205 const base::string16& message) { | 206 const base::string16& message) { |
206 DCHECK(infobar->owner()); | 207 DCHECK(infobar->owner()); |
207 infobar->owner()->ReplaceInfoBar( | 208 infobar->owner()->ReplaceInfoBar( |
208 infobar, infobar->owner()->CreateConfirmInfoBar( | 209 infobar, infobar->owner()->CreateConfirmInfoBar( |
209 std::unique_ptr<ConfirmInfoBarDelegate>( | 210 std::unique_ptr<ConfirmInfoBarDelegate>( |
210 new OutdatedPluginInfoBarDelegate( | 211 new OutdatedPluginInfoBarDelegate( |
211 installer, std::move(plugin_metadata), message)))); | 212 installer, std::move(plugin_metadata), message)))); |
212 } | 213 } |
213 | 214 |
214 #endif // defined(ENABLE_PLUGIN_INSTALLATION) | 215 #endif // BUILDFLAG(ENABLE_PLUGIN_INSTALLATION) |
OLD | NEW |