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/plugin_installer.h" | 5 #include "chrome/browser/plugin_installer.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/string_util.h" | 9 #include "base/string_util.h" |
10 #include "chrome/browser/renderer_host/render_view_host.h" | 10 #include "chrome/browser/renderer_host/render_view_host.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 tab_contents_->RemoveInfoBar(this); | 36 tab_contents_->RemoveInfoBar(this); |
37 break; | 37 break; |
38 } | 38 } |
39 default: { | 39 default: { |
40 NOTREACHED(); | 40 NOTREACHED(); |
41 break; | 41 break; |
42 } | 42 } |
43 } | 43 } |
44 } | 44 } |
45 | 45 |
46 std::wstring PluginInstaller::GetMessageText() const { | 46 string16 PluginInstaller::GetMessageText() const { |
47 return l10n_util::GetString(IDS_PLUGININSTALLER_MISSINGPLUGIN_PROMPT); | 47 return l10n_util::GetStringUTF16(IDS_PLUGININSTALLER_MISSINGPLUGIN_PROMPT); |
48 } | 48 } |
49 | 49 |
50 SkBitmap* PluginInstaller::GetIcon() const { | 50 SkBitmap* PluginInstaller::GetIcon() const { |
51 return ResourceBundle::GetSharedInstance().GetBitmapNamed( | 51 return ResourceBundle::GetSharedInstance().GetBitmapNamed( |
52 IDR_INFOBAR_PLUGIN_INSTALL); | 52 IDR_INFOBAR_PLUGIN_INSTALL); |
53 } | 53 } |
54 | 54 |
55 int PluginInstaller::GetButtons() const { | 55 int PluginInstaller::GetButtons() const { |
56 return BUTTON_OK; | 56 return BUTTON_OK; |
57 } | 57 } |
58 | 58 |
59 std::wstring PluginInstaller::GetButtonLabel(InfoBarButton button) const { | 59 string16 PluginInstaller::GetButtonLabel(InfoBarButton button) const { |
60 if (button == BUTTON_OK) | 60 if (button == BUTTON_OK) |
61 return l10n_util::GetString(IDS_PLUGININSTALLER_INSTALLPLUGIN_BUTTON); | 61 return l10n_util::GetStringUTF16(IDS_PLUGININSTALLER_INSTALLPLUGIN_BUTTON); |
62 return ConfirmInfoBarDelegate::GetButtonLabel(button); | 62 return ConfirmInfoBarDelegate::GetButtonLabel(button); |
63 } | 63 } |
64 | 64 |
65 bool PluginInstaller::Accept() { | 65 bool PluginInstaller::Accept() { |
66 tab_contents_->render_view_host()->InstallMissingPlugin(); | 66 tab_contents_->render_view_host()->InstallMissingPlugin(); |
67 return true; | 67 return true; |
68 } | 68 } |
69 | 69 |
70 std::wstring PluginInstaller::GetLinkText() { | 70 string16 PluginInstaller::GetLinkText() { |
71 return l10n_util::GetString(IDS_PLUGININSTALLER_PROBLEMSINSTALLING); | 71 return l10n_util::GetStringUTF16(IDS_PLUGININSTALLER_PROBLEMSINSTALLING); |
72 } | 72 } |
73 | 73 |
74 bool PluginInstaller::LinkClicked(WindowOpenDisposition disposition) { | 74 bool PluginInstaller::LinkClicked(WindowOpenDisposition disposition) { |
75 // Ignore the click dispostion and always open in a new top level tab. | 75 // Ignore the click dispostion and always open in a new top level tab. |
76 tab_contents_->OpenURL( | 76 tab_contents_->OpenURL( |
77 GURL(l10n_util::GetStringUTF8(IDS_LEARN_MORE_PLUGININSTALLER_URL)), | 77 GURL(l10n_util::GetStringUTF8(IDS_LEARN_MORE_PLUGININSTALLER_URL)), |
78 GURL(), NEW_FOREGROUND_TAB, PageTransition::LINK); | 78 GURL(), NEW_FOREGROUND_TAB, PageTransition::LINK); |
79 return false; // Do not dismiss the info bar. | 79 return false; // Do not dismiss the info bar. |
80 } | 80 } |
OLD | NEW |