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

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

Issue 1845343005: Makes MaterialDesignController initialization explicit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Avoids a need to use AllowReinitialization Created 4 years, 8 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 8
9 #include "base/base_paths.h" 9 #include "base/base_paths.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 #include "chrome/renderer/chrome_content_renderer_client.h" 44 #include "chrome/renderer/chrome_content_renderer_client.h"
45 #include "chrome/utility/chrome_content_utility_client.h" 45 #include "chrome/utility/chrome_content_utility_client.h"
46 #include "components/component_updater/component_updater_paths.h" 46 #include "components/component_updater/component_updater_paths.h"
47 #include "components/content_settings/core/common/content_settings_pattern.h" 47 #include "components/content_settings/core/common/content_settings_pattern.h"
48 #include "components/crash/content/app/crash_reporter_client.h" 48 #include "components/crash/content/app/crash_reporter_client.h"
49 #include "components/version_info/version_info.h" 49 #include "components/version_info/version_info.h"
50 #include "content/public/common/content_client.h" 50 #include "content/public/common/content_client.h"
51 #include "content/public/common/content_paths.h" 51 #include "content/public/common/content_paths.h"
52 #include "content/public/common/content_switches.h" 52 #include "content/public/common/content_switches.h"
53 #include "extensions/common/constants.h" 53 #include "extensions/common/constants.h"
54 #include "ui/base/material_design/material_design_controller.h"
54 #include "ui/base/resource/resource_bundle.h" 55 #include "ui/base/resource/resource_bundle.h"
55 #include "ui/base/ui_base_switches.h" 56 #include "ui/base/ui_base_switches.h"
56 57
57 #if defined(OS_WIN) 58 #if defined(OS_WIN)
58 #include <atlbase.h> 59 #include <atlbase.h>
59 #include <malloc.h> 60 #include <malloc.h>
60 #include <algorithm> 61 #include <algorithm>
61 #include "base/debug/close_handle_hook_win.h" 62 #include "base/debug/close_handle_hook_win.h"
62 #include "chrome/common/child_process_logging.h" 63 #include "chrome/common/child_process_logging.h"
63 #include "chrome/common/v8_breakpad_support_win.h" 64 #include "chrome/common/v8_breakpad_support_win.h"
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after
785 for (size_t i = 0; i < arraysize(extra_pak_keys); ++i) { 786 for (size_t i = 0; i < arraysize(extra_pak_keys); ++i) {
786 pak_fd = global_descriptors->Get(extra_pak_keys[i]); 787 pak_fd = global_descriptors->Get(extra_pak_keys[i]);
787 pak_region = global_descriptors->GetRegion(extra_pak_keys[i]); 788 pak_region = global_descriptors->GetRegion(extra_pak_keys[i]);
788 ResourceBundle::GetSharedInstance().AddDataPackFromFileRegion( 789 ResourceBundle::GetSharedInstance().AddDataPackFromFileRegion(
789 base::File(pak_fd), pak_region, ui::SCALE_FACTOR_100P); 790 base::File(pak_fd), pak_region, ui::SCALE_FACTOR_100P);
790 } 791 }
791 792
792 base::i18n::SetICUDefaultLocale(locale); 793 base::i18n::SetICUDefaultLocale(locale);
793 const std::string loaded_locale = locale; 794 const std::string loaded_locale = locale;
794 #else 795 #else
796 ui::MaterialDesignController::Initialize();
795 const std::string loaded_locale = 797 const std::string loaded_locale =
796 ui::ResourceBundle::InitSharedInstanceWithLocale( 798 ui::ResourceBundle::InitSharedInstanceWithLocale(
797 locale, NULL, ui::ResourceBundle::LOAD_COMMON_RESOURCES); 799 locale, NULL, ui::ResourceBundle::LOAD_COMMON_RESOURCES);
798 800
799 base::FilePath resources_pack_path; 801 base::FilePath resources_pack_path;
800 PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path); 802 PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path);
801 ResourceBundle::GetSharedInstance().AddDataPackFromPath( 803 ResourceBundle::GetSharedInstance().AddDataPackFromPath(
802 resources_pack_path, ui::SCALE_FACTOR_NONE); 804 resources_pack_path, ui::SCALE_FACTOR_NONE);
803 #endif 805 #endif
804 CHECK(!loaded_locale.empty()) << "Locale could not be found for " << 806 CHECK(!loaded_locale.empty()) << "Locale could not be found for " <<
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
1016 case version_info::Channel::CANARY: 1018 case version_info::Channel::CANARY:
1017 return true; 1019 return true;
1018 case version_info::Channel::DEV: 1020 case version_info::Channel::DEV:
1019 case version_info::Channel::BETA: 1021 case version_info::Channel::BETA:
1020 case version_info::Channel::STABLE: 1022 case version_info::Channel::STABLE:
1021 default: 1023 default:
1022 // Don't enable instrumentation. 1024 // Don't enable instrumentation.
1023 return false; 1025 return false;
1024 } 1026 }
1025 } 1027 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698