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

Side by Side Diff: chrome/browser/ui/startup/bad_flags_prompt.cc

Issue 457103003: Merge ResourceBundle's InitSharedInstanceLocaleOnly with InitSharedInstanceWithLocale(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: REBASE Created 6 years, 4 months 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/browser/chrome_browser_main_mac.mm ('k') | chrome/service/service_process.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) 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/ui/startup/bad_flags_prompt.h" 5 #include "chrome/browser/ui/startup/bad_flags_prompt.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/infobars/infobar_service.h" 10 #include "chrome/browser/infobars/infobar_service.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 startup_metric_utils::SetNonBrowserUIDisplayed(); 99 startup_metric_utils::SetNonBrowserUIDisplayed();
100 100
101 // Ensure the ResourceBundle is initialized for string resource access. 101 // Ensure the ResourceBundle is initialized for string resource access.
102 bool cleanup_resource_bundle = false; 102 bool cleanup_resource_bundle = false;
103 if (!ResourceBundle::HasSharedInstance()) { 103 if (!ResourceBundle::HasSharedInstance()) {
104 cleanup_resource_bundle = true; 104 cleanup_resource_bundle = true;
105 std::string locale = l10n_util::GetApplicationLocale(std::string()); 105 std::string locale = l10n_util::GetApplicationLocale(std::string());
106 const char kUserDataDirDialogFallbackLocale[] = "en-US"; 106 const char kUserDataDirDialogFallbackLocale[] = "en-US";
107 if (locale.empty()) 107 if (locale.empty())
108 locale = kUserDataDirDialogFallbackLocale; 108 locale = kUserDataDirDialogFallbackLocale;
109 ResourceBundle::InitSharedInstanceWithLocale(locale, NULL); 109 ui::ResourceBundle::InitSharedInstanceWithLocale(
110 locale, NULL, ui::ResourceBundle::LOAD_COMMON_RESOURCES);
110 } 111 }
111 112
112 const base::string16& title = 113 const base::string16& title =
113 l10n_util::GetStringUTF16(IDS_CANT_WRITE_USER_DIRECTORY_TITLE); 114 l10n_util::GetStringUTF16(IDS_CANT_WRITE_USER_DIRECTORY_TITLE);
114 const base::string16& message = 115 const base::string16& message =
115 l10n_util::GetStringFUTF16(IDS_CANT_WRITE_USER_DIRECTORY_SUMMARY, 116 l10n_util::GetStringFUTF16(IDS_CANT_WRITE_USER_DIRECTORY_SUMMARY,
116 user_data_dir.LossyDisplayName()); 117 user_data_dir.LossyDisplayName());
117 118
118 if (cleanup_resource_bundle) 119 if (cleanup_resource_bundle)
119 ResourceBundle::CleanupSharedInstance(); 120 ResourceBundle::CleanupSharedInstance();
120 121
121 // More complex dialogs cannot be shown before the earliest calls here. 122 // More complex dialogs cannot be shown before the earliest calls here.
122 ShowMessageBox(NULL, title, message, chrome::MESSAGE_BOX_TYPE_WARNING); 123 ShowMessageBox(NULL, title, message, chrome::MESSAGE_BOX_TYPE_WARNING);
123 } 124 }
124 125
125 } // namespace chrome 126 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/chrome_browser_main_mac.mm ('k') | chrome/service/service_process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698