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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/content_settings/host_content_settings_map.h" | 10 #include "chrome/browser/content_settings/host_content_settings_map.h" |
11 #include "chrome/browser/google/google_util.h" | 11 #include "chrome/browser/google/google_util.h" |
12 #include "chrome/browser/infobars/infobar.h" | |
13 #include "chrome/browser/infobars/infobar_service.h" | 12 #include "chrome/browser/infobars/infobar_service.h" |
14 #include "chrome/browser/lifetime/application_lifetime.h" | 13 #include "chrome/browser/lifetime/application_lifetime.h" |
15 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" | 14 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" |
16 #include "chrome/browser/plugins/plugin_metadata.h" | 15 #include "chrome/browser/plugins/plugin_metadata.h" |
17 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
18 #include "chrome/browser/shell_integration.h" | 17 #include "chrome/browser/shell_integration.h" |
19 #include "chrome/browser/ui/browser_commands.h" | 18 #include "chrome/browser/ui/browser_commands.h" |
20 #include "chrome/common/url_constants.h" | 19 #include "chrome/common/url_constants.h" |
| 20 #include "components/infobars/core/infobar.h" |
21 #include "content/public/browser/render_process_host.h" | 21 #include "content/public/browser/render_process_host.h" |
22 #include "content/public/browser/render_view_host.h" | 22 #include "content/public/browser/render_view_host.h" |
23 #include "content/public/browser/user_metrics.h" | 23 #include "content/public/browser/user_metrics.h" |
24 #include "content/public/browser/web_contents.h" | 24 #include "content/public/browser/web_contents.h" |
25 #include "grit/generated_resources.h" | 25 #include "grit/generated_resources.h" |
26 #include "grit/locale_settings.h" | 26 #include "grit/locale_settings.h" |
27 #include "grit/theme_resources.h" | 27 #include "grit/theme_resources.h" |
28 #include "ui/base/l10n/l10n_util.h" | 28 #include "ui/base/l10n/l10n_util.h" |
29 | 29 |
30 #if defined(ENABLE_PLUGIN_INSTALLATION) | 30 #if defined(ENABLE_PLUGIN_INSTALLATION) |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( | 321 infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( |
322 scoped_ptr<ConfirmInfoBarDelegate>(new PluginInstallerInfoBarDelegate( | 322 scoped_ptr<ConfirmInfoBarDelegate>(new PluginInstallerInfoBarDelegate( |
323 installer, plugin_metadata.Pass(), callback, true, | 323 installer, plugin_metadata.Pass(), callback, true, |
324 l10n_util::GetStringFUTF16( | 324 l10n_util::GetStringFUTF16( |
325 (installer->state() == PluginInstaller::INSTALLER_STATE_IDLE) ? | 325 (installer->state() == PluginInstaller::INSTALLER_STATE_IDLE) ? |
326 IDS_PLUGININSTALLER_INSTALLPLUGIN_PROMPT : | 326 IDS_PLUGININSTALLER_INSTALLPLUGIN_PROMPT : |
327 IDS_PLUGIN_DOWNLOADING, | 327 IDS_PLUGIN_DOWNLOADING, |
328 name))))); | 328 name))))); |
329 } | 329 } |
330 | 330 |
331 | |
332 void PluginInstallerInfoBarDelegate::Replace( | 331 void PluginInstallerInfoBarDelegate::Replace( |
333 InfoBar* infobar, | 332 infobars::InfoBar* infobar, |
334 PluginInstaller* installer, | 333 PluginInstaller* installer, |
335 scoped_ptr<PluginMetadata> plugin_metadata, | 334 scoped_ptr<PluginMetadata> plugin_metadata, |
336 bool new_install, | 335 bool new_install, |
337 const base::string16& message) { | 336 const base::string16& message) { |
338 DCHECK(infobar->owner()); | 337 DCHECK(infobar->owner()); |
339 infobar->owner()->ReplaceInfoBar(infobar, | 338 infobar->owner()->ReplaceInfoBar(infobar, |
340 ConfirmInfoBarDelegate::CreateInfoBar(scoped_ptr<ConfirmInfoBarDelegate>( | 339 ConfirmInfoBarDelegate::CreateInfoBar(scoped_ptr<ConfirmInfoBarDelegate>( |
341 new PluginInstallerInfoBarDelegate( | 340 new PluginInstallerInfoBarDelegate( |
342 installer, plugin_metadata.Pass(), | 341 installer, plugin_metadata.Pass(), |
343 PluginInstallerInfoBarDelegate::InstallCallback(), new_install, | 342 PluginInstallerInfoBarDelegate::InstallCallback(), new_install, |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
528 "https://support.google.com/chrome/?p=ib_redirect_to_desktop"), | 527 "https://support.google.com/chrome/?p=ib_redirect_to_desktop"), |
529 content::Referrer(), | 528 content::Referrer(), |
530 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, | 529 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, |
531 content::PAGE_TRANSITION_LINK, false)); | 530 content::PAGE_TRANSITION_LINK, false)); |
532 return false; | 531 return false; |
533 } | 532 } |
534 | 533 |
535 #endif // defined(OS_WIN) | 534 #endif // defined(OS_WIN) |
536 | 535 |
537 #endif // defined(ENABLE_PLUGIN_INSTALLATION) | 536 #endif // defined(ENABLE_PLUGIN_INSTALLATION) |
OLD | NEW |