| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/blocked_plugin_manager.h" | 5 #include "chrome/browser/blocked_plugin_manager.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/renderer_host/render_view_host.h" | 10 #include "chrome/browser/renderer_host/render_view_host.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 } | 22 } |
| 23 | 23 |
| 24 void BlockedPluginManager::OnBlockedPluginLoaded() { | 24 void BlockedPluginManager::OnBlockedPluginLoaded() { |
| 25 tab_contents_->RemoveInfoBar(this); | 25 tab_contents_->RemoveInfoBar(this); |
| 26 } | 26 } |
| 27 | 27 |
| 28 int BlockedPluginManager::GetButtons() const { | 28 int BlockedPluginManager::GetButtons() const { |
| 29 return BUTTON_OK; | 29 return BUTTON_OK; |
| 30 } | 30 } |
| 31 | 31 |
| 32 std::wstring BlockedPluginManager::GetButtonLabel(InfoBarButton button) const { | 32 string16 BlockedPluginManager::GetButtonLabel(InfoBarButton button) const { |
| 33 if (button == BUTTON_OK) | 33 if (button == BUTTON_OK) |
| 34 return l10n_util::GetString(IDS_PLUGIN_LOAD_SHORT); | 34 return l10n_util::GetStringUTF16(IDS_PLUGIN_LOAD_SHORT); |
| 35 return ConfirmInfoBarDelegate::GetButtonLabel(button); | 35 return ConfirmInfoBarDelegate::GetButtonLabel(button); |
| 36 } | 36 } |
| 37 | 37 |
| 38 std::wstring BlockedPluginManager::GetMessageText() const { | 38 string16 BlockedPluginManager::GetMessageText() const { |
| 39 return UTF16ToWide(l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED_PROMPT, | 39 return l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED_PROMPT, name_); |
| 40 name_)); | |
| 41 } | 40 } |
| 42 | 41 |
| 43 std::wstring BlockedPluginManager::GetLinkText() { | 42 string16 BlockedPluginManager::GetLinkText() { |
| 44 return l10n_util::GetString(IDS_LEARN_MORE); | 43 return l10n_util::GetStringUTF16(IDS_LEARN_MORE); |
| 45 } | 44 } |
| 46 | 45 |
| 47 SkBitmap* BlockedPluginManager::GetIcon() const { | 46 SkBitmap* BlockedPluginManager::GetIcon() const { |
| 48 return ResourceBundle::GetSharedInstance().GetBitmapNamed( | 47 return ResourceBundle::GetSharedInstance().GetBitmapNamed( |
| 49 IDR_INFOBAR_PLUGIN_INSTALL); | 48 IDR_INFOBAR_PLUGIN_INSTALL); |
| 50 } | 49 } |
| 51 | 50 |
| 52 bool BlockedPluginManager::Accept() { | 51 bool BlockedPluginManager::Accept() { |
| 53 tab_contents_->render_view_host()->LoadBlockedPlugins(); | 52 tab_contents_->render_view_host()->LoadBlockedPlugins(); |
| 54 return true; | 53 return true; |
| 55 } | 54 } |
| 56 | 55 |
| 57 bool BlockedPluginManager::LinkClicked(WindowOpenDisposition disposition) { | 56 bool BlockedPluginManager::LinkClicked(WindowOpenDisposition disposition) { |
| 58 // TODO(bauerb): Navigate to a help page explaining why we blocked the plugin, | 57 // TODO(bauerb): Navigate to a help page explaining why we blocked the plugin, |
| 59 // once we have one. | 58 // once we have one. |
| 60 return false; | 59 return false; |
| 61 } | 60 } |
| OLD | NEW |