| 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/default_plugin/install_dialog.h" | 5 #include "chrome/default_plugin/install_dialog.h" |
| 6 | 6 |
| 7 #include "base/hash_tables.h" | 7 #include "base/hash_tables.h" |
| 8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| 11 #include "chrome/default_plugin/plugin_impl.h" | 11 #include "chrome/default_plugin/plugin_impl.h" |
| 12 #include "grit/webkit_strings.h" | 12 #include "grit/webkit_strings.h" |
| 13 #include "ui/base/l10n/l10n_util.h" | 13 #include "ui/base/l10n/l10n_util.h" |
| 14 #include "webkit/glue/webkit_glue.h" | 14 #include "webkit/glue/webkit_glue.h" |
| 15 | 15 |
| 16 typedef base::hash_map<const std::wstring, PluginInstallDialog*> DialogMap; | 16 typedef base::hash_map<const std::wstring, PluginInstallDialog*> DialogMap; |
| 17 base::LazyInstance<DialogMap> s_dialogs(base::LINKER_INITIALIZED); | 17 base::LazyInstance<DialogMap> s_dialogs = LAZY_INSTANCE_INITIALIZER; |
| 18 | 18 |
| 19 PluginInstallDialog* PluginInstallDialog::AddInstaller( | 19 PluginInstallDialog* PluginInstallDialog::AddInstaller( |
| 20 PluginInstallerImpl* plugin_impl, const std::wstring& plugin_name) { | 20 PluginInstallerImpl* plugin_impl, const std::wstring& plugin_name) { |
| 21 PluginInstallDialog* dialog; | 21 PluginInstallDialog* dialog; |
| 22 if (s_dialogs.Get().count(plugin_name)) { | 22 if (s_dialogs.Get().count(plugin_name)) { |
| 23 dialog = s_dialogs.Get()[plugin_name]; | 23 dialog = s_dialogs.Get()[plugin_name]; |
| 24 } else { | 24 } else { |
| 25 dialog = new PluginInstallDialog(plugin_name); | 25 dialog = new PluginInstallDialog(plugin_name); |
| 26 } | 26 } |
| 27 | 27 |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 // same code. | 195 // same code. |
| 196 void PluginInstallDialog::AdjustTextDirectionality(std::wstring* text) const { | 196 void PluginInstallDialog::AdjustTextDirectionality(std::wstring* text) const { |
| 197 if (PluginInstallerImpl::IsRTLLayout()) { | 197 if (PluginInstallerImpl::IsRTLLayout()) { |
| 198 // Inserting an RLE (Right-To-Left Embedding) mark as the first character. | 198 // Inserting an RLE (Right-To-Left Embedding) mark as the first character. |
| 199 text->insert(0, L"\x202B"); | 199 text->insert(0, L"\x202B"); |
| 200 | 200 |
| 201 // Inserting a PDF (Pop Directional Formatting) mark as the last character. | 201 // Inserting a PDF (Pop Directional Formatting) mark as the last character. |
| 202 text->append(L"\x202C"); | 202 text->append(L"\x202C"); |
| 203 } | 203 } |
| 204 } | 204 } |
| OLD | NEW |