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_observer.h" | 5 #include "chrome/browser/plugins/plugin_observer.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
260 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_BlockedOutdatedPlugin, | 260 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_BlockedOutdatedPlugin, |
261 OnBlockedOutdatedPlugin) | 261 OnBlockedOutdatedPlugin) |
262 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_BlockedComponentUpdatedPlugin, | 262 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_BlockedComponentUpdatedPlugin, |
263 OnBlockedComponentUpdatedPlugin) | 263 OnBlockedComponentUpdatedPlugin) |
264 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_RemovePluginPlaceholderHost, | 264 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_RemovePluginPlaceholderHost, |
265 OnRemovePluginPlaceholderHost) | 265 OnRemovePluginPlaceholderHost) |
266 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_ShowFlashPermissionBubble, | 266 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_ShowFlashPermissionBubble, |
267 OnShowFlashPermissionBubble) | 267 OnShowFlashPermissionBubble) |
268 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_CouldNotLoadPlugin, | 268 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_CouldNotLoadPlugin, |
269 OnCouldNotLoadPlugin) | 269 OnCouldNotLoadPlugin) |
270 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_OpenPDF, OnOpenPDF) | |
270 | 271 |
271 IPC_MESSAGE_UNHANDLED(return false) | 272 IPC_MESSAGE_UNHANDLED(return false) |
272 IPC_END_MESSAGE_MAP() | 273 IPC_END_MESSAGE_MAP() |
273 | 274 |
274 return true; | 275 return true; |
275 } | 276 } |
276 | 277 |
277 void PluginObserver::OnBlockedOutdatedPlugin(int placeholder_id, | 278 void PluginObserver::OnBlockedOutdatedPlugin(int placeholder_id, |
278 const std::string& identifier) { | 279 const std::string& identifier) { |
279 PluginFinder* finder = PluginFinder::GetInstance(); | 280 PluginFinder* finder = PluginFinder::GetInstance(); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
328 plugin_path); | 329 plugin_path); |
329 base::string16 plugin_name = | 330 base::string16 plugin_name = |
330 PluginService::GetInstance()->GetPluginDisplayNameByPath(plugin_path); | 331 PluginService::GetInstance()->GetPluginDisplayNameByPath(plugin_path); |
331 SimpleAlertInfoBarDelegate::Create( | 332 SimpleAlertInfoBarDelegate::Create( |
332 InfoBarService::FromWebContents(web_contents()), | 333 InfoBarService::FromWebContents(web_contents()), |
333 infobars::InfoBarDelegate::PLUGIN_OBSERVER, &kExtensionCrashedIcon, | 334 infobars::InfoBarDelegate::PLUGIN_OBSERVER, &kExtensionCrashedIcon, |
334 l10n_util::GetStringFUTF16(IDS_PLUGIN_INITIALIZATION_ERROR_PROMPT, | 335 l10n_util::GetStringFUTF16(IDS_PLUGIN_INITIALIZATION_ERROR_PROMPT, |
335 plugin_name), | 336 plugin_name), |
336 true); | 337 true); |
337 } | 338 } |
339 | |
340 void PluginObserver::OnOpenPDF(const GURL& url) { | |
341 web_contents()->OpenURL(content::OpenURLParams( | |
342 url, | |
343 content::Referrer::SanitizeForRequest( | |
344 url, content::Referrer(web_contents()->GetURL(), | |
345 blink::kWebReferrerPolicyDefault)), | |
346 WindowOpenDisposition::NEW_FOREGROUND_TAB, | |
347 ui::PAGE_TRANSITION_AUTO_BOOKMARK, false)); | |
Lei Zhang
2017/07/07 22:47:58
I'm not sure if these are correct, but I also don'
amberwon
2017/07/11 18:08:05
They were used for OnOpenAboutPlugins, when the pl
Lei Zhang
2017/07/12 00:51:37
Well, since the code being referred to was removed
| |
348 } | |
OLD | NEW |