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/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/api/infobars/infobar_service.h" | 8 #include "chrome/browser/api/infobars/infobar_service.h" |
9 #include "chrome/browser/content_settings/host_content_settings_map.h" | 9 #include "chrome/browser/content_settings/host_content_settings_map.h" |
10 #include "chrome/browser/google/google_util.h" | 10 #include "chrome/browser/google/google_util.h" |
11 #include "chrome/browser/lifetime/application_lifetime.h" | 11 #include "chrome/browser/lifetime/application_lifetime.h" |
| 12 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" |
12 #include "chrome/browser/plugins/plugin_metadata.h" | 13 #include "chrome/browser/plugins/plugin_metadata.h" |
13 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/common/render_messages.h" | 15 #include "chrome/common/render_messages.h" |
15 #include "chrome/common/url_constants.h" | 16 #include "chrome/common/url_constants.h" |
| 17 #include "content/public/browser/render_process_host.h" |
16 #include "content/public/browser/render_view_host.h" | 18 #include "content/public/browser/render_view_host.h" |
17 #include "content/public/browser/user_metrics.h" | 19 #include "content/public/browser/user_metrics.h" |
18 #include "content/public/browser/web_contents.h" | 20 #include "content/public/browser/web_contents.h" |
19 #include "grit/generated_resources.h" | 21 #include "grit/generated_resources.h" |
20 #include "grit/locale_settings.h" | 22 #include "grit/locale_settings.h" |
21 #include "grit/theme_resources.h" | 23 #include "grit/theme_resources.h" |
22 #include "ui/base/l10n/l10n_util.h" | 24 #include "ui/base/l10n/l10n_util.h" |
23 #include "ui/base/resource/resource_bundle.h" | 25 #include "ui/base/resource/resource_bundle.h" |
24 | 26 |
25 #if defined(OS_WIN) | 27 #if defined(OS_WIN) |
(...skipping 29 matching lines...) Expand all Loading... |
55 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, | 57 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, |
56 content::PAGE_TRANSITION_LINK, | 58 content::PAGE_TRANSITION_LINK, |
57 false); | 59 false); |
58 owner()->GetWebContents()->OpenURL(params); | 60 owner()->GetWebContents()->OpenURL(params); |
59 return false; | 61 return false; |
60 } | 62 } |
61 | 63 |
62 void PluginInfoBarDelegate::LoadBlockedPlugins() { | 64 void PluginInfoBarDelegate::LoadBlockedPlugins() { |
63 content::WebContents* web_contents = owner()->GetWebContents(); | 65 content::WebContents* web_contents = owner()->GetWebContents(); |
64 if (web_contents) { | 66 if (web_contents) { |
65 web_contents->Send(new ChromeViewMsg_LoadBlockedPlugins( | 67 content::RenderViewHost* host = web_contents->GetRenderViewHost(); |
66 web_contents->GetRoutingID(), identifier_)); | 68 ChromePluginServiceFilter::GetInstance()->AuthorizeAllPlugins( |
| 69 host->GetProcess()->GetID()); |
| 70 host->Send(new ChromeViewMsg_LoadBlockedPlugins( |
| 71 host->GetRoutingID(), identifier_)); |
67 } | 72 } |
68 } | 73 } |
69 | 74 |
70 gfx::Image* PluginInfoBarDelegate::GetIcon() const { | 75 gfx::Image* PluginInfoBarDelegate::GetIcon() const { |
71 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( | 76 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( |
72 IDR_INFOBAR_PLUGIN_INSTALL); | 77 IDR_INFOBAR_PLUGIN_INSTALL); |
73 } | 78 } |
74 | 79 |
75 string16 PluginInfoBarDelegate::GetLinkText() const { | 80 string16 PluginInfoBarDelegate::GetLinkText() const { |
76 return l10n_util::GetStringUTF16(IDS_LEARN_MORE); | 81 return l10n_util::GetStringUTF16(IDS_LEARN_MORE); |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 "https://support.google.com/chrome/?p=ib_display_in_desktop" : | 550 "https://support.google.com/chrome/?p=ib_display_in_desktop" : |
546 "https://support.google.com/chrome/?p=ib_redirect_to_desktop"), | 551 "https://support.google.com/chrome/?p=ib_redirect_to_desktop"), |
547 Referrer(), | 552 Referrer(), |
548 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, | 553 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, |
549 content::PAGE_TRANSITION_LINK, false); | 554 content::PAGE_TRANSITION_LINK, false); |
550 owner()->GetWebContents()->OpenURL(params); | 555 owner()->GetWebContents()->OpenURL(params); |
551 return false; | 556 return false; |
552 } | 557 } |
553 #endif // defined(OS_WIN) | 558 #endif // defined(OS_WIN) |
554 #endif // defined(ENABLE_PLUGIN_INSTALLATION) | 559 #endif // defined(ENABLE_PLUGIN_INSTALLATION) |
OLD | NEW |