| 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/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/content_settings/host_content_settings_map.h" | 10 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 InfoBarService::WebContentsFromInfoBar(infobar())->OpenURL( | 61 InfoBarService::WebContentsFromInfoBar(infobar())->OpenURL( |
| 62 content::OpenURLParams( | 62 content::OpenURLParams( |
| 63 GURL(GetLearnMoreURL()), content::Referrer(), | 63 GURL(GetLearnMoreURL()), content::Referrer(), |
| 64 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, | 64 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, |
| 65 content::PAGE_TRANSITION_LINK, false)); | 65 ui::PAGE_TRANSITION_LINK, false)); |
| 66 return false; | 66 return false; |
| 67 } | 67 } |
| 68 | 68 |
| 69 void PluginInfoBarDelegate::LoadBlockedPlugins() { | 69 void PluginInfoBarDelegate::LoadBlockedPlugins() { |
| 70 content::WebContents* web_contents = | 70 content::WebContents* web_contents = |
| 71 InfoBarService::WebContentsFromInfoBar(infobar()); | 71 InfoBarService::WebContentsFromInfoBar(infobar()); |
| 72 ChromePluginServiceFilter::GetInstance()->AuthorizeAllPlugins( | 72 ChromePluginServiceFilter::GetInstance()->AuthorizeAllPlugins( |
| 73 web_contents, true, identifier_); | 73 web_contents, true, identifier_); |
| 74 } | 74 } |
| 75 | 75 |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 WindowOpenDisposition disposition) { | 394 WindowOpenDisposition disposition) { |
| 395 GURL url(plugin_metadata_->help_url()); | 395 GURL url(plugin_metadata_->help_url()); |
| 396 if (url.is_empty()) { | 396 if (url.is_empty()) { |
| 397 url = GURL( | 397 url = GURL( |
| 398 "https://www.google.com/support/chrome/bin/answer.py?answer=142064"); | 398 "https://www.google.com/support/chrome/bin/answer.py?answer=142064"); |
| 399 } | 399 } |
| 400 InfoBarService::WebContentsFromInfoBar(infobar())->OpenURL( | 400 InfoBarService::WebContentsFromInfoBar(infobar())->OpenURL( |
| 401 content::OpenURLParams( | 401 content::OpenURLParams( |
| 402 url, content::Referrer(), | 402 url, content::Referrer(), |
| 403 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, | 403 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, |
| 404 content::PAGE_TRANSITION_LINK, false)); | 404 ui::PAGE_TRANSITION_LINK, false)); |
| 405 return false; | 405 return false; |
| 406 } | 406 } |
| 407 | 407 |
| 408 void PluginInstallerInfoBarDelegate::DownloadStarted() { | 408 void PluginInstallerInfoBarDelegate::DownloadStarted() { |
| 409 ReplaceWithInfoBar(l10n_util::GetStringFUTF16(IDS_PLUGIN_DOWNLOADING, | 409 ReplaceWithInfoBar(l10n_util::GetStringFUTF16(IDS_PLUGIN_DOWNLOADING, |
| 410 plugin_metadata_->name())); | 410 plugin_metadata_->name())); |
| 411 } | 411 } |
| 412 | 412 |
| 413 void PluginInstallerInfoBarDelegate::DownloadCancelled() { | 413 void PluginInstallerInfoBarDelegate::DownloadCancelled() { |
| 414 ReplaceWithInfoBar(l10n_util::GetStringFUTF16(IDS_PLUGIN_DOWNLOAD_CANCELLED, | 414 ReplaceWithInfoBar(l10n_util::GetStringFUTF16(IDS_PLUGIN_DOWNLOAD_CANCELLED, |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 // TODO(shrikant): We may need to change language a little at following | 514 // TODO(shrikant): We may need to change language a little at following |
| 515 // support URLs. With new approach we will just restart for both missing | 515 // support URLs. With new approach we will just restart for both missing |
| 516 // and not missing mode. | 516 // and not missing mode. |
| 517 InfoBarService::WebContentsFromInfoBar(infobar())->OpenURL( | 517 InfoBarService::WebContentsFromInfoBar(infobar())->OpenURL( |
| 518 content::OpenURLParams( | 518 content::OpenURLParams( |
| 519 GURL((mode_ == MISSING_PLUGIN) ? | 519 GURL((mode_ == MISSING_PLUGIN) ? |
| 520 "https://support.google.com/chrome/?p=ib_display_in_desktop" : | 520 "https://support.google.com/chrome/?p=ib_display_in_desktop" : |
| 521 "https://support.google.com/chrome/?p=ib_redirect_to_desktop"), | 521 "https://support.google.com/chrome/?p=ib_redirect_to_desktop"), |
| 522 content::Referrer(), | 522 content::Referrer(), |
| 523 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, | 523 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, |
| 524 content::PAGE_TRANSITION_LINK, false)); | 524 ui::PAGE_TRANSITION_LINK, false)); |
| 525 return false; | 525 return false; |
| 526 } | 526 } |
| 527 | 527 |
| 528 #endif // defined(OS_WIN) | 528 #endif // defined(OS_WIN) |
| 529 | 529 |
| 530 #endif // defined(ENABLE_PLUGIN_INSTALLATION) | 530 #endif // defined(ENABLE_PLUGIN_INSTALLATION) |
| OLD | NEW |