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

Side by Side Diff: chrome/browser/chrome_browser_main.cc

Issue 1878973002: [reland] Makes MaterialDesignController initialization explicit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Made it possible to restore MaterialDesignController state after each test case (nits) 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/browser/chrome_browser_main.h" 5 #include "chrome/browser/chrome_browser_main.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 #include "content/public/common/main_function_params.h" 150 #include "content/public/common/main_function_params.h"
151 #include "grit/platform_locale_settings.h" 151 #include "grit/platform_locale_settings.h"
152 #include "media/base/media_resources.h" 152 #include "media/base/media_resources.h"
153 #include "net/base/net_module.h" 153 #include "net/base/net_module.h"
154 #include "net/cookies/cookie_monster.h" 154 #include "net/cookies/cookie_monster.h"
155 #include "net/http/http_network_layer.h" 155 #include "net/http/http_network_layer.h"
156 #include "net/http/http_stream_factory.h" 156 #include "net/http/http_stream_factory.h"
157 #include "net/url_request/url_request.h" 157 #include "net/url_request/url_request.h"
158 #include "ui/base/l10n/l10n_util.h" 158 #include "ui/base/l10n/l10n_util.h"
159 #include "ui/base/layout.h" 159 #include "ui/base/layout.h"
160 #include "ui/base/material_design/material_design_controller.h"
160 #include "ui/base/resource/resource_bundle.h" 161 #include "ui/base/resource/resource_bundle.h"
161 #include "ui/strings/grit/app_locale_settings.h" 162 #include "ui/strings/grit/app_locale_settings.h"
162 163
163 #if BUILDFLAG(ANDROID_JAVA_UI) 164 #if BUILDFLAG(ANDROID_JAVA_UI)
164 #include "chrome/browser/android/dev_tools_discovery_provider_android.h" 165 #include "chrome/browser/android/dev_tools_discovery_provider_android.h"
165 #else 166 #else
166 #include "chrome/browser/devtools/chrome_devtools_discovery_provider.h" 167 #include "chrome/browser/devtools/chrome_devtools_discovery_provider.h"
167 #endif 168 #endif
168 169
169 #if defined(OS_ANDROID) 170 #if defined(OS_ANDROID)
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after
967 { 968 {
968 TRACE_EVENT0("startup", 969 TRACE_EVENT0("startup",
969 "ChromeBrowserMainParts::PreCreateThreadsImpl:ConvertFlags"); 970 "ChromeBrowserMainParts::PreCreateThreadsImpl:ConvertFlags");
970 flags_ui::PrefServiceFlagsStorage flags_storage_( 971 flags_ui::PrefServiceFlagsStorage flags_storage_(
971 g_browser_process->local_state()); 972 g_browser_process->local_state());
972 about_flags::ConvertFlagsToSwitches(&flags_storage_, 973 about_flags::ConvertFlagsToSwitches(&flags_storage_,
973 base::CommandLine::ForCurrentProcess(), 974 base::CommandLine::ForCurrentProcess(),
974 flags_ui::kAddSentinels); 975 flags_ui::kAddSentinels);
975 } 976 }
976 #endif // !defined(OS_CHROMEOS) 977 #endif // !defined(OS_CHROMEOS)
978 // The MaterialDesignController needs to look at command line flags, which
979 // are not available until this point. Now that they are, proceed with
980 // initializing the MaterialDesignController.
981 ui::MaterialDesignController::Initialize();
977 982
978 #if defined(OS_MACOSX) 983 #if defined(OS_MACOSX)
979 // The MaterialDesignController needs to look at command line flags, which 984 // Material Design resource packs can be loaded now that command line flags
980 // are not available until this point. Now that they are, proceed with 985 // are set. See https://crbug.com/585290 .
981 // (conditionally) loading the Material Design resource packs. See
982 // https://crbug.com/585290 .
983 ui::ResourceBundle::GetSharedInstance().LoadMaterialDesignResources(); 986 ui::ResourceBundle::GetSharedInstance().LoadMaterialDesignResources();
984 #endif 987 #endif
985 988
986 #if defined(OS_WIN) 989 #if defined(OS_WIN)
987 // This is needed to enable ETW exporting when requested in about:flags. 990 // This is needed to enable ETW exporting when requested in about:flags.
988 // Normally, we enable it in ContentMainRunnerImpl::Initialize when the flag 991 // Normally, we enable it in ContentMainRunnerImpl::Initialize when the flag
989 // is present on the command line but flags in about:flags are converted only 992 // is present on the command line but flags in about:flags are converted only
990 // after this function runs. Note that this starts exporting later which 993 // after this function runs. Note that this starts exporting later which
991 // affects tracing the browser startup. Also, this is only relevant for the 994 // affects tracing the browser startup. Also, this is only relevant for the
992 // browser process, as other processes will get all the flags on their command 995 // browser process, as other processes will get all the flags on their command
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after
1943 chromeos::CrosSettings::Shutdown(); 1946 chromeos::CrosSettings::Shutdown();
1944 #endif // defined(OS_CHROMEOS) 1947 #endif // defined(OS_CHROMEOS)
1945 #endif // defined(OS_ANDROID) 1948 #endif // defined(OS_ANDROID)
1946 } 1949 }
1947 1950
1948 // Public members: 1951 // Public members:
1949 1952
1950 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { 1953 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) {
1951 chrome_extra_parts_.push_back(parts); 1954 chrome_extra_parts_.push_back(parts);
1952 } 1955 }
OLDNEW
« no previous file with comments | « chrome/app/resources/resources_unittest.cc ('k') | chrome/browser/extensions/extension_action_icon_factory_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698