| 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/path_service.h" | 8 #include "base/path_service.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/content_settings/host_content_settings_map.h" | 10 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 10 #include "chrome/browser/google/google_util.h" | 11 #include "chrome/browser/google/google_util.h" |
| 11 #include "chrome/browser/infobars/infobar.h" | 12 #include "chrome/browser/infobars/infobar.h" |
| 12 #include "chrome/browser/infobars/infobar_service.h" | 13 #include "chrome/browser/infobars/infobar_service.h" |
| 13 #include "chrome/browser/lifetime/application_lifetime.h" | 14 #include "chrome/browser/lifetime/application_lifetime.h" |
| 14 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" | 15 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" |
| 15 #include "chrome/browser/plugins/plugin_metadata.h" | 16 #include "chrome/browser/plugins/plugin_metadata.h" |
| 16 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
| 17 #include "chrome/browser/shell_integration.h" | 18 #include "chrome/browser/shell_integration.h" |
| 18 #include "chrome/browser/ui/browser_commands.h" | 19 #include "chrome/browser/ui/browser_commands.h" |
| 19 #include "chrome/common/render_messages.h" | |
| 20 #include "chrome/common/url_constants.h" | 20 #include "chrome/common/url_constants.h" |
| 21 #include "content/public/browser/browser_thread.h" | 21 #include "content/public/browser/browser_thread.h" |
| 22 #include "content/public/browser/render_process_host.h" | 22 #include "content/public/browser/render_process_host.h" |
| 23 #include "content/public/browser/render_view_host.h" | 23 #include "content/public/browser/render_view_host.h" |
| 24 #include "content/public/browser/user_metrics.h" | 24 #include "content/public/browser/user_metrics.h" |
| 25 #include "content/public/browser/web_contents.h" | 25 #include "content/public/browser/web_contents.h" |
| 26 #include "grit/generated_resources.h" | 26 #include "grit/generated_resources.h" |
| 27 #include "grit/locale_settings.h" | 27 #include "grit/locale_settings.h" |
| 28 #include "grit/theme_resources.h" | 28 #include "grit/theme_resources.h" |
| 29 #include "ui/base/l10n/l10n_util.h" | 29 #include "ui/base/l10n/l10n_util.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 59 | 59 |
| 60 bool PluginInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) { | 60 bool PluginInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) { |
| 61 web_contents()->OpenURL(content::OpenURLParams( | 61 web_contents()->OpenURL(content::OpenURLParams( |
| 62 GURL(GetLearnMoreURL()), content::Referrer(), | 62 GURL(GetLearnMoreURL()), content::Referrer(), |
| 63 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, | 63 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, |
| 64 content::PAGE_TRANSITION_LINK, false)); | 64 content::PAGE_TRANSITION_LINK, false)); |
| 65 return false; | 65 return false; |
| 66 } | 66 } |
| 67 | 67 |
| 68 void PluginInfoBarDelegate::LoadBlockedPlugins() { | 68 void PluginInfoBarDelegate::LoadBlockedPlugins() { |
| 69 content::RenderViewHost* host = web_contents()->GetRenderViewHost(); | |
| 70 ChromePluginServiceFilter::GetInstance()->AuthorizeAllPlugins( | 69 ChromePluginServiceFilter::GetInstance()->AuthorizeAllPlugins( |
| 71 host->GetProcess()->GetID()); | 70 web_contents(), true, identifier_); |
| 72 host->Send(new ChromeViewMsg_LoadBlockedPlugins( | |
| 73 host->GetRoutingID(), identifier_)); | |
| 74 } | 71 } |
| 75 | 72 |
| 76 int PluginInfoBarDelegate::GetIconID() const { | 73 int PluginInfoBarDelegate::GetIconID() const { |
| 77 return IDR_INFOBAR_PLUGIN_INSTALL; | 74 return IDR_INFOBAR_PLUGIN_INSTALL; |
| 78 } | 75 } |
| 79 | 76 |
| 80 string16 PluginInfoBarDelegate::GetLinkText() const { | 77 string16 PluginInfoBarDelegate::GetLinkText() const { |
| 81 return l10n_util::GetStringUTF16(IDS_LEARN_MORE); | 78 return l10n_util::GetStringUTF16(IDS_LEARN_MORE); |
| 82 } | 79 } |
| 83 | 80 |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 "https://support.google.com/chrome/?p=ib_redirect_to_desktop"), | 522 "https://support.google.com/chrome/?p=ib_redirect_to_desktop"), |
| 526 content::Referrer(), | 523 content::Referrer(), |
| 527 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, | 524 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, |
| 528 content::PAGE_TRANSITION_LINK, false)); | 525 content::PAGE_TRANSITION_LINK, false)); |
| 529 return false; | 526 return false; |
| 530 } | 527 } |
| 531 | 528 |
| 532 #endif // defined(OS_WIN) | 529 #endif // defined(OS_WIN) |
| 533 | 530 |
| 534 #endif // defined(ENABLE_PLUGIN_INSTALLATION) | 531 #endif // defined(ENABLE_PLUGIN_INSTALLATION) |
| OLD | NEW |