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

Side by Side Diff: chrome/app/chrome_main_delegate.cc

Issue 2933343002: Deduplicate Monochrome locale .paks (Closed)
Patch Set: Addressing comments Created 3 years, 5 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
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/app/chrome_main_delegate.h" 5 #include "chrome/app/chrome_main_delegate.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <string> 8 #include <string>
9 9
10 #include "base/base_paths.h" 10 #include "base/base_paths.h"
(...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after
881 kAndroidChrome100PercentPakDescriptor, 881 kAndroidChrome100PercentPakDescriptor,
882 kAndroidUIResourcesPakDescriptor, 882 kAndroidUIResourcesPakDescriptor,
883 }; 883 };
884 for (size_t i = 0; i < arraysize(extra_pak_keys); ++i) { 884 for (size_t i = 0; i < arraysize(extra_pak_keys); ++i) {
885 pak_fd = global_descriptors->Get(extra_pak_keys[i]); 885 pak_fd = global_descriptors->Get(extra_pak_keys[i]);
886 pak_region = global_descriptors->GetRegion(extra_pak_keys[i]); 886 pak_region = global_descriptors->GetRegion(extra_pak_keys[i]);
887 ResourceBundle::GetSharedInstance().AddDataPackFromFileRegion( 887 ResourceBundle::GetSharedInstance().AddDataPackFromFileRegion(
888 base::File(pak_fd), pak_region, ui::SCALE_FACTOR_100P); 888 base::File(pak_fd), pak_region, ui::SCALE_FACTOR_100P);
889 } 889 }
890 890
891 // Load secondary locale .pak file if it exists.
Lei Zhang 2017/06/29 19:08:31 Do you want to move the newly added code up to lin
F 2017/06/29 19:20:03 Done.
892 pak_fd = global_descriptors->MaybeGet(kAndroidSecondaryLocalePakDescriptor);
893 if (pak_fd != -1) {
894 pak_region = global_descriptors->GetRegion(
895 kAndroidSecondaryLocalePakDescriptor);
896 ResourceBundle::GetSharedInstance().
897 LoadSecondaryLocaleDataWithPakFileRegion(
898 base::File(pak_fd), pak_region);
899 }
900
891 base::i18n::SetICUDefaultLocale(locale); 901 base::i18n::SetICUDefaultLocale(locale);
892 const std::string loaded_locale = locale; 902 const std::string loaded_locale = locale;
893 #else 903 #else
894 ui::MaterialDesignController::Initialize(); 904 ui::MaterialDesignController::Initialize();
895 const std::string loaded_locale = 905 const std::string loaded_locale =
896 ui::ResourceBundle::InitSharedInstanceWithLocale( 906 ui::ResourceBundle::InitSharedInstanceWithLocale(
897 locale, NULL, ui::ResourceBundle::LOAD_COMMON_RESOURCES); 907 locale, NULL, ui::ResourceBundle::LOAD_COMMON_RESOURCES);
898 908
899 base::FilePath resources_pack_path; 909 base::FilePath resources_pack_path;
900 PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path); 910 PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path);
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
1222 1232
1223 std::unique_ptr<service_manager::Service> 1233 std::unique_ptr<service_manager::Service>
1224 ChromeMainDelegate::CreateEmbeddedService(const std::string& service_name) { 1234 ChromeMainDelegate::CreateEmbeddedService(const std::string& service_name) {
1225 #if BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES) 1235 #if BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES)
1226 auto mash_service = CreateEmbeddedMashService(service_name); 1236 auto mash_service = CreateEmbeddedMashService(service_name);
1227 if (mash_service) 1237 if (mash_service)
1228 return mash_service; 1238 return mash_service;
1229 #endif // BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES) 1239 #endif // BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES)
1230 return nullptr; 1240 return nullptr;
1231 } 1241 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698