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

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

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

Powered by Google App Engine
This is Rietveld 408576698