| 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 "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 PluginFinder* plugin_finder) { | 248 PluginFinder* plugin_finder) { |
| 249 PluginInstaller* installer = | 249 PluginInstaller* installer = |
| 250 plugin_finder->FindPluginWithIdentifier(identifier); | 250 plugin_finder->FindPluginWithIdentifier(identifier); |
| 251 DCHECK(installer) << "Couldn't find PluginInstaller for identifier " | 251 DCHECK(installer) << "Couldn't find PluginInstaller for identifier " |
| 252 << identifier; | 252 << identifier; |
| 253 plugin_placeholders_[placeholder_id] = | 253 plugin_placeholders_[placeholder_id] = |
| 254 new PluginPlaceholderHost(this, placeholder_id, installer); | 254 new PluginPlaceholderHost(this, placeholder_id, installer); |
| 255 TabContents* tab_contents = TabContents::FromWebContents(web_contents()); | 255 TabContents* tab_contents = TabContents::FromWebContents(web_contents()); |
| 256 InfoBarTabHelper* infobar_helper = tab_contents->infobar_tab_helper(); | 256 InfoBarTabHelper* infobar_helper = tab_contents->infobar_tab_helper(); |
| 257 infobar_helper->AddInfoBar( | 257 infobar_helper->AddInfoBar( |
| 258 OutdatedPluginInfoBarDelegate::Create(this, installer)); | 258 OutdatedPluginInfoBarDelegate::Create(web_contents(), installer)); |
| 259 } | 259 } |
| 260 | 260 |
| 261 void PluginObserver::OnFindMissingPlugin(int placeholder_id, | 261 void PluginObserver::OnFindMissingPlugin(int placeholder_id, |
| 262 const std::string& mime_type) { | 262 const std::string& mime_type) { |
| 263 PluginFinder::Get(base::Bind(&PluginObserver::FindMissingPlugin, | 263 PluginFinder::Get(base::Bind(&PluginObserver::FindMissingPlugin, |
| 264 weak_ptr_factory_.GetWeakPtr(), | 264 weak_ptr_factory_.GetWeakPtr(), |
| 265 placeholder_id, mime_type)); | 265 placeholder_id, mime_type)); |
| 266 } | 266 } |
| 267 | 267 |
| 268 void PluginObserver::FindMissingPlugin(int placeholder_id, | 268 void PluginObserver::FindMissingPlugin(int placeholder_id, |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 InfoBarTabHelper* infobar_helper = tab_contents->infobar_tab_helper(); | 335 InfoBarTabHelper* infobar_helper = tab_contents->infobar_tab_helper(); |
| 336 infobar_helper->AddInfoBar(new SimpleAlertInfoBarDelegate( | 336 infobar_helper->AddInfoBar(new SimpleAlertInfoBarDelegate( |
| 337 infobar_helper, | 337 infobar_helper, |
| 338 &ResourceBundle::GetSharedInstance().GetNativeImageNamed( | 338 &ResourceBundle::GetSharedInstance().GetNativeImageNamed( |
| 339 IDR_INFOBAR_PLUGIN_CRASHED), | 339 IDR_INFOBAR_PLUGIN_CRASHED), |
| 340 l10n_util::GetStringFUTF16(IDS_PLUGIN_INITIALIZATION_ERROR_PROMPT, | 340 l10n_util::GetStringFUTF16(IDS_PLUGIN_INITIALIZATION_ERROR_PROMPT, |
| 341 plugin_name), | 341 plugin_name), |
| 342 true /* auto_expire */)); | 342 true /* auto_expire */)); |
| 343 } | 343 } |
| 344 | 344 |
| OLD | NEW |