| 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/plugin_observer.h" | 5 #include "chrome/browser/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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 NOTREACHED(); | 211 NOTREACHED(); |
| 212 #endif // defined(ENABLE_PLUGIN_INSTALLATION) | 212 #endif // defined(ENABLE_PLUGIN_INSTALLATION) |
| 213 } | 213 } |
| 214 | 214 |
| 215 #if defined(ENABLE_PLUGIN_INSTALLATION) | 215 #if defined(ENABLE_PLUGIN_INSTALLATION) |
| 216 void PluginObserver::FindPluginToUpdate(int placeholder_id, | 216 void PluginObserver::FindPluginToUpdate(int placeholder_id, |
| 217 const std::string& identifier, | 217 const std::string& identifier, |
| 218 PluginFinder* plugin_finder) { | 218 PluginFinder* plugin_finder) { |
| 219 PluginInstaller* installer = | 219 PluginInstaller* installer = |
| 220 plugin_finder->FindPluginWithIdentifier(identifier); | 220 plugin_finder->FindPluginWithIdentifier(identifier); |
| 221 // TODO(bauerb): Remove this CHECK once http://crbug.com/121657 is fixed. | 221 DCHECK(installer) << "Couldn't find PluginInstaller for identifier " |
| 222 CHECK(installer) << "Couldn't find PluginInstaller for identifier " | 222 << identifier; |
| 223 << identifier; | |
| 224 plugin_placeholders_[placeholder_id] = | 223 plugin_placeholders_[placeholder_id] = |
| 225 new PluginPlaceholderHost(this, placeholder_id, installer); | 224 new PluginPlaceholderHost(this, placeholder_id, installer); |
| 226 InfoBarTabHelper* infobar_helper = tab_contents_->infobar_tab_helper(); | 225 InfoBarTabHelper* infobar_helper = tab_contents_->infobar_tab_helper(); |
| 227 infobar_helper->AddInfoBar( | 226 infobar_helper->AddInfoBar( |
| 228 OutdatedPluginInfoBarDelegate::Create(this, installer)); | 227 OutdatedPluginInfoBarDelegate::Create(this, installer)); |
| 229 } | 228 } |
| 230 | 229 |
| 231 void PluginObserver::OnFindMissingPlugin(int placeholder_id, | 230 void PluginObserver::OnFindMissingPlugin(int placeholder_id, |
| 232 const std::string& mime_type) { | 231 const std::string& mime_type) { |
| 233 PluginFinder::Get(base::Bind(&PluginObserver::FindMissingPlugin, | 232 PluginFinder::Get(base::Bind(&PluginObserver::FindMissingPlugin, |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 } | 276 } |
| 278 #endif // defined(ENABLE_PLUGIN_INSTALLATION) | 277 #endif // defined(ENABLE_PLUGIN_INSTALLATION) |
| 279 | 278 |
| 280 void PluginObserver::OnOpenAboutPlugins() { | 279 void PluginObserver::OnOpenAboutPlugins() { |
| 281 web_contents()->OpenURL(OpenURLParams( | 280 web_contents()->OpenURL(OpenURLParams( |
| 282 GURL(chrome::kAboutPluginsURL), | 281 GURL(chrome::kAboutPluginsURL), |
| 283 content::Referrer(web_contents()->GetURL(), | 282 content::Referrer(web_contents()->GetURL(), |
| 284 WebKit::WebReferrerPolicyDefault), | 283 WebKit::WebReferrerPolicyDefault), |
| 285 NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_TYPED, false)); | 284 NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_TYPED, false)); |
| 286 } | 285 } |
| OLD | NEW |