| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/content_settings/host_content_settings_map.h" | 8 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 9 #include "chrome/browser/google/google_util.h" | 9 #include "chrome/browser/google/google_util.h" |
| 10 #include "chrome/browser/plugin_installer_infobar_delegate.h" | 10 #include "chrome/browser/plugin_installer_infobar_delegate.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 const string16& name) | 58 const string16& name) |
| 59 : ConfirmInfoBarDelegate(tab_contents), | 59 : ConfirmInfoBarDelegate(tab_contents), |
| 60 name_(name), | 60 name_(name), |
| 61 tab_contents_(tab_contents) { | 61 tab_contents_(tab_contents) { |
| 62 } | 62 } |
| 63 | 63 |
| 64 PluginInfoBarDelegate::~PluginInfoBarDelegate() { | 64 PluginInfoBarDelegate::~PluginInfoBarDelegate() { |
| 65 } | 65 } |
| 66 | 66 |
| 67 bool PluginInfoBarDelegate::Cancel() { | 67 bool PluginInfoBarDelegate::Cancel() { |
| 68 tab_contents_->render_view_host()->Send(new ViewMsg_LoadBlockedPlugins( | 68 tab_contents_->render_view_host()->Send(new ChromeViewMsg_LoadBlockedPlugins( |
| 69 tab_contents_->render_view_host()->routing_id())); | 69 tab_contents_->render_view_host()->routing_id())); |
| 70 return true; | 70 return true; |
| 71 } | 71 } |
| 72 | 72 |
| 73 bool PluginInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) { | 73 bool PluginInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) { |
| 74 tab_contents_->OpenURL( | 74 tab_contents_->OpenURL( |
| 75 google_util::AppendGoogleLocaleParam(GURL(GetLearnMoreURL())), GURL(), | 75 google_util::AppendGoogleLocaleParam(GURL(GetLearnMoreURL())), GURL(), |
| 76 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, | 76 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, |
| 77 PageTransition::LINK); | 77 PageTransition::LINK); |
| 78 return false; | 78 return false; |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 tab_contents_(tab_contents) { | 289 tab_contents_(tab_contents) { |
| 290 } | 290 } |
| 291 | 291 |
| 292 PluginObserver::~PluginObserver() { | 292 PluginObserver::~PluginObserver() { |
| 293 } | 293 } |
| 294 | 294 |
| 295 bool PluginObserver::OnMessageReceived(const IPC::Message& message) { | 295 bool PluginObserver::OnMessageReceived(const IPC::Message& message) { |
| 296 IPC_BEGIN_MESSAGE_MAP(PluginObserver, message) | 296 IPC_BEGIN_MESSAGE_MAP(PluginObserver, message) |
| 297 IPC_MESSAGE_HANDLER(ViewHostMsg_MissingPluginStatus, OnMissingPluginStatus) | 297 IPC_MESSAGE_HANDLER(ViewHostMsg_MissingPluginStatus, OnMissingPluginStatus) |
| 298 IPC_MESSAGE_HANDLER(ViewHostMsg_CrashedPlugin, OnCrashedPlugin) | 298 IPC_MESSAGE_HANDLER(ViewHostMsg_CrashedPlugin, OnCrashedPlugin) |
| 299 IPC_MESSAGE_HANDLER(ViewHostMsg_BlockedOutdatedPlugin, | 299 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_BlockedOutdatedPlugin, |
| 300 OnBlockedOutdatedPlugin) | 300 OnBlockedOutdatedPlugin) |
| 301 IPC_MESSAGE_UNHANDLED(return false) | 301 IPC_MESSAGE_UNHANDLED(return false) |
| 302 IPC_END_MESSAGE_MAP() | 302 IPC_END_MESSAGE_MAP() |
| 303 | 303 |
| 304 return true; | 304 return true; |
| 305 } | 305 } |
| 306 | 306 |
| 307 PluginInstallerInfoBarDelegate* PluginObserver::GetPluginInstaller() { | 307 PluginInstallerInfoBarDelegate* PluginObserver::GetPluginInstaller() { |
| 308 if (plugin_installer_ == NULL) | 308 if (plugin_installer_ == NULL) |
| 309 plugin_installer_.reset(new PluginInstallerInfoBarDelegate(tab_contents())); | 309 plugin_installer_.reset(new PluginInstallerInfoBarDelegate(tab_contents())); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 true)); | 356 true)); |
| 357 } | 357 } |
| 358 | 358 |
| 359 void PluginObserver::OnBlockedOutdatedPlugin(const string16& name, | 359 void PluginObserver::OnBlockedOutdatedPlugin(const string16& name, |
| 360 const GURL& update_url) { | 360 const GURL& update_url) { |
| 361 tab_contents_->AddInfoBar(update_url.is_empty() ? | 361 tab_contents_->AddInfoBar(update_url.is_empty() ? |
| 362 static_cast<InfoBarDelegate*>(new BlockedPluginInfoBarDelegate( | 362 static_cast<InfoBarDelegate*>(new BlockedPluginInfoBarDelegate( |
| 363 tab_contents(), name)) : | 363 tab_contents(), name)) : |
| 364 new OutdatedPluginInfoBarDelegate(tab_contents(), name, update_url)); | 364 new OutdatedPluginInfoBarDelegate(tab_contents(), name, update_url)); |
| 365 } | 365 } |
| OLD | NEW |