| 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/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.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/infobars/infobar.h" | |
| 12 #include "chrome/browser/infobars/infobar_service.h" | 11 #include "chrome/browser/infobars/infobar_service.h" |
| 13 #include "chrome/browser/lifetime/application_lifetime.h" | 12 #include "chrome/browser/lifetime/application_lifetime.h" |
| 14 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" | 13 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" |
| 15 #include "chrome/browser/plugins/plugin_metadata.h" | 14 #include "chrome/browser/plugins/plugin_metadata.h" |
| 16 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
| 17 #include "chrome/browser/shell_integration.h" | 16 #include "chrome/browser/shell_integration.h" |
| 18 #include "chrome/browser/ui/browser_commands.h" | 17 #include "chrome/browser/ui/browser_commands.h" |
| 19 #include "chrome/common/render_messages.h" | 18 #include "chrome/common/render_messages.h" |
| 20 #include "chrome/common/url_constants.h" | 19 #include "chrome/common/url_constants.h" |
| 21 #include "content/public/browser/browser_thread.h" | 20 #include "content/public/browser/browser_thread.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 42 #if defined(USE_AURA) | 41 #if defined(USE_AURA) |
| 43 #include "ui/aura/remote_root_window_host_win.h" | 42 #include "ui/aura/remote_root_window_host_win.h" |
| 44 #endif | 43 #endif |
| 45 #endif | 44 #endif |
| 46 | 45 |
| 47 using content::UserMetricsAction; | 46 using content::UserMetricsAction; |
| 48 | 47 |
| 49 | 48 |
| 50 // PluginInfoBarDelegate ------------------------------------------------------ | 49 // PluginInfoBarDelegate ------------------------------------------------------ |
| 51 | 50 |
| 52 PluginInfoBarDelegate::PluginInfoBarDelegate(const std::string& identifier) | 51 PluginInfoBarDelegate::PluginInfoBarDelegate(InfoBarService* infobar_service, |
| 53 : ConfirmInfoBarDelegate(), | 52 const std::string& identifier) |
| 53 : ConfirmInfoBarDelegate(infobar_service), |
| 54 identifier_(identifier) { | 54 identifier_(identifier) { |
| 55 } | 55 } |
| 56 | 56 |
| 57 PluginInfoBarDelegate::~PluginInfoBarDelegate() { | 57 PluginInfoBarDelegate::~PluginInfoBarDelegate() { |
| 58 } | 58 } |
| 59 | 59 |
| 60 bool PluginInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) { | 60 bool PluginInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) { |
| 61 web_contents()->OpenURL(content::OpenURLParams( | 61 web_contents()->OpenURL(content::OpenURLParams( |
| 62 GURL(GetLearnMoreURL()), content::Referrer(), | 62 GURL(GetLearnMoreURL()), content::Referrer(), |
| 63 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, | 63 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, |
| (...skipping 19 matching lines...) Expand all Loading... |
| 83 | 83 |
| 84 | 84 |
| 85 // UnauthorizedPluginInfoBarDelegate ------------------------------------------ | 85 // UnauthorizedPluginInfoBarDelegate ------------------------------------------ |
| 86 | 86 |
| 87 // static | 87 // static |
| 88 void UnauthorizedPluginInfoBarDelegate::Create( | 88 void UnauthorizedPluginInfoBarDelegate::Create( |
| 89 InfoBarService* infobar_service, | 89 InfoBarService* infobar_service, |
| 90 HostContentSettingsMap* content_settings, | 90 HostContentSettingsMap* content_settings, |
| 91 const string16& name, | 91 const string16& name, |
| 92 const std::string& identifier) { | 92 const std::string& identifier) { |
| 93 infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( | 93 infobar_service->AddInfoBar(scoped_ptr<InfoBarDelegate>( |
| 94 scoped_ptr<ConfirmInfoBarDelegate>(new UnauthorizedPluginInfoBarDelegate( | 94 new UnauthorizedPluginInfoBarDelegate(infobar_service, content_settings, |
| 95 content_settings, name, identifier)))); | 95 name, identifier))); |
| 96 | 96 |
| 97 content::RecordAction(UserMetricsAction("BlockedPluginInfobar.Shown")); | 97 content::RecordAction(UserMetricsAction("BlockedPluginInfobar.Shown")); |
| 98 std::string utf8_name(UTF16ToUTF8(name)); | 98 std::string utf8_name(UTF16ToUTF8(name)); |
| 99 if (utf8_name == PluginMetadata::kJavaGroupName) { | 99 if (utf8_name == PluginMetadata::kJavaGroupName) { |
| 100 content::RecordAction(UserMetricsAction("BlockedPluginInfobar.Shown.Java")); | 100 content::RecordAction(UserMetricsAction("BlockedPluginInfobar.Shown.Java")); |
| 101 } else if (utf8_name == PluginMetadata::kQuickTimeGroupName) { | 101 } else if (utf8_name == PluginMetadata::kQuickTimeGroupName) { |
| 102 content::RecordAction( | 102 content::RecordAction( |
| 103 UserMetricsAction("BlockedPluginInfobar.Shown.QuickTime")); | 103 UserMetricsAction("BlockedPluginInfobar.Shown.QuickTime")); |
| 104 } else if (utf8_name == PluginMetadata::kShockwaveGroupName) { | 104 } else if (utf8_name == PluginMetadata::kShockwaveGroupName) { |
| 105 content::RecordAction( | 105 content::RecordAction( |
| 106 UserMetricsAction("BlockedPluginInfobar.Shown.Shockwave")); | 106 UserMetricsAction("BlockedPluginInfobar.Shown.Shockwave")); |
| 107 } else if (utf8_name == PluginMetadata::kRealPlayerGroupName) { | 107 } else if (utf8_name == PluginMetadata::kRealPlayerGroupName) { |
| 108 content::RecordAction( | 108 content::RecordAction( |
| 109 UserMetricsAction("BlockedPluginInfobar.Shown.RealPlayer")); | 109 UserMetricsAction("BlockedPluginInfobar.Shown.RealPlayer")); |
| 110 } else if (utf8_name == PluginMetadata::kWindowsMediaPlayerGroupName) { | 110 } else if (utf8_name == PluginMetadata::kWindowsMediaPlayerGroupName) { |
| 111 content::RecordAction( | 111 content::RecordAction( |
| 112 UserMetricsAction("BlockedPluginInfobar.Shown.WindowsMediaPlayer")); | 112 UserMetricsAction("BlockedPluginInfobar.Shown.WindowsMediaPlayer")); |
| 113 } | 113 } |
| 114 } | 114 } |
| 115 | 115 |
| 116 UnauthorizedPluginInfoBarDelegate::UnauthorizedPluginInfoBarDelegate( | 116 UnauthorizedPluginInfoBarDelegate::UnauthorizedPluginInfoBarDelegate( |
| 117 InfoBarService* infobar_service, |
| 117 HostContentSettingsMap* content_settings, | 118 HostContentSettingsMap* content_settings, |
| 118 const string16& name, | 119 const string16& name, |
| 119 const std::string& identifier) | 120 const std::string& identifier) |
| 120 : PluginInfoBarDelegate(identifier), | 121 : PluginInfoBarDelegate(infobar_service, identifier), |
| 121 content_settings_(content_settings), | 122 content_settings_(content_settings), |
| 122 name_(name) { | 123 name_(name) { |
| 123 } | 124 } |
| 124 | 125 |
| 125 UnauthorizedPluginInfoBarDelegate::~UnauthorizedPluginInfoBarDelegate() { | 126 UnauthorizedPluginInfoBarDelegate::~UnauthorizedPluginInfoBarDelegate() { |
| 126 content::RecordAction(UserMetricsAction("BlockedPluginInfobar.Closed")); | 127 content::RecordAction(UserMetricsAction("BlockedPluginInfobar.Closed")); |
| 127 } | 128 } |
| 128 | 129 |
| 129 std::string UnauthorizedPluginInfoBarDelegate::GetLearnMoreURL() const { | 130 std::string UnauthorizedPluginInfoBarDelegate::GetLearnMoreURL() const { |
| 130 return chrome::kBlockedPluginLearnMoreURL; | 131 return chrome::kBlockedPluginLearnMoreURL; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 | 172 |
| 172 // OutdatedPluginInfoBarDelegate ---------------------------------------------- | 173 // OutdatedPluginInfoBarDelegate ---------------------------------------------- |
| 173 | 174 |
| 174 void OutdatedPluginInfoBarDelegate::Create( | 175 void OutdatedPluginInfoBarDelegate::Create( |
| 175 InfoBarService* infobar_service, | 176 InfoBarService* infobar_service, |
| 176 PluginInstaller* installer, | 177 PluginInstaller* installer, |
| 177 scoped_ptr<PluginMetadata> plugin_metadata) { | 178 scoped_ptr<PluginMetadata> plugin_metadata) { |
| 178 // Copy the name out of |plugin_metadata| now, since the Pass() call below | 179 // Copy the name out of |plugin_metadata| now, since the Pass() call below |
| 179 // will make it impossible to get at. | 180 // will make it impossible to get at. |
| 180 string16 name(plugin_metadata->name()); | 181 string16 name(plugin_metadata->name()); |
| 181 infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( | 182 infobar_service->AddInfoBar(scoped_ptr<InfoBarDelegate>( |
| 182 scoped_ptr<ConfirmInfoBarDelegate>(new OutdatedPluginInfoBarDelegate( | 183 new OutdatedPluginInfoBarDelegate( |
| 183 installer, plugin_metadata.Pass(), l10n_util::GetStringFUTF16( | 184 infobar_service, installer, plugin_metadata.Pass(), |
| 185 l10n_util::GetStringFUTF16( |
| 184 (installer->state() == PluginInstaller::INSTALLER_STATE_IDLE) ? | 186 (installer->state() == PluginInstaller::INSTALLER_STATE_IDLE) ? |
| 185 IDS_PLUGIN_OUTDATED_PROMPT : IDS_PLUGIN_DOWNLOADING, | 187 IDS_PLUGIN_OUTDATED_PROMPT : IDS_PLUGIN_DOWNLOADING, |
| 186 name))))); | 188 name)))); |
| 187 } | 189 } |
| 188 | 190 |
| 189 OutdatedPluginInfoBarDelegate::OutdatedPluginInfoBarDelegate( | 191 OutdatedPluginInfoBarDelegate::OutdatedPluginInfoBarDelegate( |
| 192 InfoBarService* infobar_service, |
| 190 PluginInstaller* installer, | 193 PluginInstaller* installer, |
| 191 scoped_ptr<PluginMetadata> plugin_metadata, | 194 scoped_ptr<PluginMetadata> plugin_metadata, |
| 192 const string16& message) | 195 const string16& message) |
| 193 : PluginInfoBarDelegate(plugin_metadata->identifier()), | 196 : PluginInfoBarDelegate(infobar_service, plugin_metadata->identifier()), |
| 194 WeakPluginInstallerObserver(installer), | 197 WeakPluginInstallerObserver(installer), |
| 195 plugin_metadata_(plugin_metadata.Pass()), | 198 plugin_metadata_(plugin_metadata.Pass()), |
| 196 message_(message) { | 199 message_(message) { |
| 197 content::RecordAction(UserMetricsAction("OutdatedPluginInfobar.Shown")); | 200 content::RecordAction(UserMetricsAction("OutdatedPluginInfobar.Shown")); |
| 198 std::string name = UTF16ToUTF8(plugin_metadata_->name()); | 201 std::string name = UTF16ToUTF8(plugin_metadata_->name()); |
| 199 if (name == PluginMetadata::kJavaGroupName) { | 202 if (name == PluginMetadata::kJavaGroupName) { |
| 200 content::RecordAction( | 203 content::RecordAction( |
| 201 UserMetricsAction("OutdatedPluginInfobar.Shown.Java")); | 204 UserMetricsAction("OutdatedPluginInfobar.Shown.Java")); |
| 202 } else if (name == PluginMetadata::kQuickTimeGroupName) { | 205 } else if (name == PluginMetadata::kQuickTimeGroupName) { |
| 203 content::RecordAction( | 206 content::RecordAction( |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 ReplaceWithInfoBar(l10n_util::GetStringFUTF16(IDS_PLUGIN_DOWNLOAD_CANCELLED, | 283 ReplaceWithInfoBar(l10n_util::GetStringFUTF16(IDS_PLUGIN_DOWNLOAD_CANCELLED, |
| 281 plugin_metadata_->name())); | 284 plugin_metadata_->name())); |
| 282 } | 285 } |
| 283 | 286 |
| 284 void OutdatedPluginInfoBarDelegate::DownloadFinished() { | 287 void OutdatedPluginInfoBarDelegate::DownloadFinished() { |
| 285 ReplaceWithInfoBar(l10n_util::GetStringFUTF16(IDS_PLUGIN_UPDATING, | 288 ReplaceWithInfoBar(l10n_util::GetStringFUTF16(IDS_PLUGIN_UPDATING, |
| 286 plugin_metadata_->name())); | 289 plugin_metadata_->name())); |
| 287 } | 290 } |
| 288 | 291 |
| 289 void OutdatedPluginInfoBarDelegate::OnlyWeakObserversLeft() { | 292 void OutdatedPluginInfoBarDelegate::OnlyWeakObserversLeft() { |
| 290 infobar()->RemoveSelf(); | 293 if (owner()) |
| 294 owner()->RemoveInfoBar(this); |
| 291 } | 295 } |
| 292 | 296 |
| 293 void OutdatedPluginInfoBarDelegate::ReplaceWithInfoBar( | 297 void OutdatedPluginInfoBarDelegate::ReplaceWithInfoBar( |
| 294 const string16& message) { | 298 const string16& message) { |
| 295 // Return early if the message doesn't change. This is important in case the | 299 // Return early if the message doesn't change. This is important in case the |
| 296 // PluginInstaller is still iterating over its observers (otherwise we would | 300 // PluginInstaller is still iterating over its observers (otherwise we would |
| 297 // keep replacing infobar delegates infinitely). | 301 // keep replacing infobar delegates infinitely). |
| 298 if ((message_ == message) || !infobar()->owner()) | 302 if ((message_ == message) || !owner()) |
| 299 return; | 303 return; |
| 300 PluginInstallerInfoBarDelegate::Replace( | 304 PluginInstallerInfoBarDelegate::Replace( |
| 301 infobar(), installer(), plugin_metadata_->Clone(), false, message); | 305 this, installer(), plugin_metadata_->Clone(), false, message); |
| 302 } | 306 } |
| 303 | 307 |
| 304 | 308 |
| 305 // PluginInstallerInfoBarDelegate --------------------------------------------- | 309 // PluginInstallerInfoBarDelegate --------------------------------------------- |
| 306 | 310 |
| 307 void PluginInstallerInfoBarDelegate::Create( | 311 void PluginInstallerInfoBarDelegate::Create( |
| 308 InfoBarService* infobar_service, | 312 InfoBarService* infobar_service, |
| 309 PluginInstaller* installer, | 313 PluginInstaller* installer, |
| 310 scoped_ptr<PluginMetadata> plugin_metadata, | 314 scoped_ptr<PluginMetadata> plugin_metadata, |
| 311 const InstallCallback& callback) { | 315 const InstallCallback& callback) { |
| 312 string16 name(plugin_metadata->name()); | 316 string16 name(plugin_metadata->name()); |
| 313 #if defined(OS_WIN) | 317 #if defined(OS_WIN) |
| 314 if (base::win::IsMetroProcess()) { | 318 if (base::win::IsMetroProcess()) { |
| 315 PluginMetroModeInfoBarDelegate::Create( | 319 PluginMetroModeInfoBarDelegate::Create( |
| 316 infobar_service, PluginMetroModeInfoBarDelegate::MISSING_PLUGIN, name); | 320 infobar_service, PluginMetroModeInfoBarDelegate::MISSING_PLUGIN, name); |
| 317 return; | 321 return; |
| 318 } | 322 } |
| 319 #endif | 323 #endif |
| 320 infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( | 324 infobar_service->AddInfoBar(scoped_ptr<InfoBarDelegate>( |
| 321 scoped_ptr<ConfirmInfoBarDelegate>(new PluginInstallerInfoBarDelegate( | 325 new PluginInstallerInfoBarDelegate( |
| 322 installer, plugin_metadata.Pass(), callback, true, | 326 infobar_service, installer, plugin_metadata.Pass(), callback, true, |
| 323 l10n_util::GetStringFUTF16( | 327 l10n_util::GetStringFUTF16( |
| 324 (installer->state() == PluginInstaller::INSTALLER_STATE_IDLE) ? | 328 (installer->state() == PluginInstaller::INSTALLER_STATE_IDLE) ? |
| 325 IDS_PLUGININSTALLER_INSTALLPLUGIN_PROMPT : | 329 IDS_PLUGININSTALLER_INSTALLPLUGIN_PROMPT : |
| 326 IDS_PLUGIN_DOWNLOADING, | 330 IDS_PLUGIN_DOWNLOADING, |
| 327 name))))); | 331 name)))); |
| 332 |
| 328 } | 333 } |
| 329 | 334 |
| 330 | |
| 331 void PluginInstallerInfoBarDelegate::Replace( | 335 void PluginInstallerInfoBarDelegate::Replace( |
| 332 InfoBar* infobar, | 336 InfoBarDelegate* infobar, |
| 333 PluginInstaller* installer, | 337 PluginInstaller* installer, |
| 334 scoped_ptr<PluginMetadata> plugin_metadata, | 338 scoped_ptr<PluginMetadata> plugin_metadata, |
| 335 bool new_install, | 339 bool new_install, |
| 336 const string16& message) { | 340 const string16& message) { |
| 337 DCHECK(infobar->owner()); | 341 DCHECK(infobar->owner()); |
| 338 infobar->owner()->ReplaceInfoBar(infobar, | 342 infobar->owner()->ReplaceInfoBar(infobar, scoped_ptr<InfoBarDelegate>( |
| 339 ConfirmInfoBarDelegate::CreateInfoBar(scoped_ptr<ConfirmInfoBarDelegate>( | 343 new PluginInstallerInfoBarDelegate( |
| 340 new PluginInstallerInfoBarDelegate( | 344 infobar->owner(), installer, plugin_metadata.Pass(), |
| 341 installer, plugin_metadata.Pass(), | 345 PluginInstallerInfoBarDelegate::InstallCallback(), new_install, |
| 342 PluginInstallerInfoBarDelegate::InstallCallback(), new_install, | 346 message))); |
| 343 message)))); | |
| 344 } | 347 } |
| 345 | 348 |
| 346 PluginInstallerInfoBarDelegate::PluginInstallerInfoBarDelegate( | 349 PluginInstallerInfoBarDelegate::PluginInstallerInfoBarDelegate( |
| 350 InfoBarService* infobar_service, |
| 347 PluginInstaller* installer, | 351 PluginInstaller* installer, |
| 348 scoped_ptr<PluginMetadata> plugin_metadata, | 352 scoped_ptr<PluginMetadata> plugin_metadata, |
| 349 const InstallCallback& callback, | 353 const InstallCallback& callback, |
| 350 bool new_install, | 354 bool new_install, |
| 351 const string16& message) | 355 const string16& message) |
| 352 : ConfirmInfoBarDelegate(), | 356 : ConfirmInfoBarDelegate(infobar_service), |
| 353 WeakPluginInstallerObserver(installer), | 357 WeakPluginInstallerObserver(installer), |
| 354 plugin_metadata_(plugin_metadata.Pass()), | 358 plugin_metadata_(plugin_metadata.Pass()), |
| 355 callback_(callback), | 359 callback_(callback), |
| 356 new_install_(new_install), | 360 new_install_(new_install), |
| 357 message_(message) { | 361 message_(message) { |
| 358 } | 362 } |
| 359 | 363 |
| 360 PluginInstallerInfoBarDelegate::~PluginInstallerInfoBarDelegate() { | 364 PluginInstallerInfoBarDelegate::~PluginInstallerInfoBarDelegate() { |
| 361 } | 365 } |
| 362 | 366 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 } | 423 } |
| 420 | 424 |
| 421 void PluginInstallerInfoBarDelegate::DownloadFinished() { | 425 void PluginInstallerInfoBarDelegate::DownloadFinished() { |
| 422 ReplaceWithInfoBar( | 426 ReplaceWithInfoBar( |
| 423 l10n_util::GetStringFUTF16( | 427 l10n_util::GetStringFUTF16( |
| 424 new_install_ ? IDS_PLUGIN_INSTALLING : IDS_PLUGIN_UPDATING, | 428 new_install_ ? IDS_PLUGIN_INSTALLING : IDS_PLUGIN_UPDATING, |
| 425 plugin_metadata_->name())); | 429 plugin_metadata_->name())); |
| 426 } | 430 } |
| 427 | 431 |
| 428 void PluginInstallerInfoBarDelegate::OnlyWeakObserversLeft() { | 432 void PluginInstallerInfoBarDelegate::OnlyWeakObserversLeft() { |
| 429 infobar()->RemoveSelf(); | 433 if (owner()) |
| 434 owner()->RemoveInfoBar(this); |
| 430 } | 435 } |
| 431 | 436 |
| 432 void PluginInstallerInfoBarDelegate::ReplaceWithInfoBar( | 437 void PluginInstallerInfoBarDelegate::ReplaceWithInfoBar( |
| 433 const string16& message) { | 438 const string16& message) { |
| 434 // Return early if the message doesn't change. This is important in case the | 439 // Return early if the message doesn't change. This is important in case the |
| 435 // PluginInstaller is still iterating over its observers (otherwise we would | 440 // PluginInstaller is still iterating over its observers (otherwise we would |
| 436 // keep replacing infobar delegates infinitely). | 441 // keep replacing infobar delegates infinitely). |
| 437 if ((message_ == message) || !infobar()->owner()) | 442 if ((message_ == message) || !owner()) |
| 438 return; | 443 return; |
| 439 Replace(infobar(), installer(), plugin_metadata_->Clone(), new_install_, | 444 Replace(this, installer(), plugin_metadata_->Clone(), new_install_, message); |
| 440 message); | |
| 441 } | 445 } |
| 442 | 446 |
| 443 | 447 |
| 444 #if defined(OS_WIN) | 448 #if defined(OS_WIN) |
| 445 | 449 |
| 446 // PluginMetroModeInfoBarDelegate --------------------------------------------- | 450 // PluginMetroModeInfoBarDelegate --------------------------------------------- |
| 447 | 451 |
| 448 // static | 452 // static |
| 449 void PluginMetroModeInfoBarDelegate::Create( | 453 void PluginMetroModeInfoBarDelegate::Create( |
| 450 InfoBarService* infobar_service, | 454 InfoBarService* infobar_service, |
| 451 PluginMetroModeInfoBarDelegate::Mode mode, | 455 PluginMetroModeInfoBarDelegate::Mode mode, |
| 452 const string16& name) { | 456 const string16& name) { |
| 453 infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( | 457 infobar_service->AddInfoBar(scoped_ptr<InfoBarDelegate>( |
| 454 scoped_ptr<ConfirmInfoBarDelegate>( | 458 new PluginMetroModeInfoBarDelegate(infobar_service, mode, name))); |
| 455 new PluginMetroModeInfoBarDelegate(mode, name)))); | |
| 456 } | 459 } |
| 457 | 460 |
| 458 PluginMetroModeInfoBarDelegate::PluginMetroModeInfoBarDelegate( | 461 PluginMetroModeInfoBarDelegate::PluginMetroModeInfoBarDelegate( |
| 462 InfoBarService* infobar_service, |
| 459 PluginMetroModeInfoBarDelegate::Mode mode, | 463 PluginMetroModeInfoBarDelegate::Mode mode, |
| 460 const string16& name) | 464 const string16& name) |
| 461 : ConfirmInfoBarDelegate(), | 465 : ConfirmInfoBarDelegate(infobar_service), |
| 462 mode_(mode), | 466 mode_(mode), |
| 463 name_(name) { | 467 name_(name) { |
| 464 } | 468 } |
| 465 | 469 |
| 466 PluginMetroModeInfoBarDelegate::~PluginMetroModeInfoBarDelegate() { | 470 PluginMetroModeInfoBarDelegate::~PluginMetroModeInfoBarDelegate() { |
| 467 } | 471 } |
| 468 | 472 |
| 469 int PluginMetroModeInfoBarDelegate::GetIconID() const { | 473 int PluginMetroModeInfoBarDelegate::GetIconID() const { |
| 470 return IDR_INFOBAR_PLUGIN_INSTALL; | 474 return IDR_INFOBAR_PLUGIN_INSTALL; |
| 471 } | 475 } |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 "https://support.google.com/chrome/?p=ib_redirect_to_desktop"), | 529 "https://support.google.com/chrome/?p=ib_redirect_to_desktop"), |
| 526 content::Referrer(), | 530 content::Referrer(), |
| 527 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, | 531 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, |
| 528 content::PAGE_TRANSITION_LINK, false)); | 532 content::PAGE_TRANSITION_LINK, false)); |
| 529 return false; | 533 return false; |
| 530 } | 534 } |
| 531 | 535 |
| 532 #endif // defined(OS_WIN) | 536 #endif // defined(OS_WIN) |
| 533 | 537 |
| 534 #endif // defined(ENABLE_PLUGIN_INSTALLATION) | 538 #endif // defined(ENABLE_PLUGIN_INSTALLATION) |
| OLD | NEW |