Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: chrome/default_plugin/install_dialog.cc

Issue 8491043: Allow linker initialization of lazy instance (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: willchan comments + rebase Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/time_format.cc ('k') | chrome/installer/util/master_preferences.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « chrome/common/time_format.cc ('k') | chrome/installer/util/master_preferences.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698