| OLD | NEW |
| 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 Loading... |
| 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" |
| 159 #include "ui/base/resource/resource_bundle.h" | 160 #include "ui/base/resource/resource_bundle.h" |
| 160 #include "ui/strings/grit/app_locale_settings.h" | 161 #include "ui/strings/grit/app_locale_settings.h" |
| 161 | 162 |
| 162 #if BUILDFLAG(ANDROID_JAVA_UI) | 163 #if BUILDFLAG(ANDROID_JAVA_UI) |
| 163 #include "chrome/browser/android/dev_tools_discovery_provider_android.h" | 164 #include "chrome/browser/android/dev_tools_discovery_provider_android.h" |
| 164 #else | 165 #else |
| 165 #include "chrome/browser/devtools/chrome_devtools_discovery_provider.h" | 166 #include "chrome/browser/devtools/chrome_devtools_discovery_provider.h" |
| 166 #endif | 167 #endif |
| 167 | 168 |
| 168 #if defined(OS_ANDROID) | 169 #if defined(OS_ANDROID) |
| (...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 961 { | 962 { |
| 962 TRACE_EVENT0("startup", | 963 TRACE_EVENT0("startup", |
| 963 "ChromeBrowserMainParts::PreCreateThreadsImpl:ConvertFlags"); | 964 "ChromeBrowserMainParts::PreCreateThreadsImpl:ConvertFlags"); |
| 964 flags_ui::PrefServiceFlagsStorage flags_storage_( | 965 flags_ui::PrefServiceFlagsStorage flags_storage_( |
| 965 g_browser_process->local_state()); | 966 g_browser_process->local_state()); |
| 966 about_flags::ConvertFlagsToSwitches(&flags_storage_, | 967 about_flags::ConvertFlagsToSwitches(&flags_storage_, |
| 967 base::CommandLine::ForCurrentProcess(), | 968 base::CommandLine::ForCurrentProcess(), |
| 968 flags_ui::kAddSentinels); | 969 flags_ui::kAddSentinels); |
| 969 } | 970 } |
| 970 #endif // !defined(OS_CHROMEOS) | 971 #endif // !defined(OS_CHROMEOS) |
| 972 // The MaterialDesignController needs to look at command line flags, which |
| 973 // are not available until this point. Now that they are, proceed with |
| 974 // initializing the MaterialDesignController. |
| 975 ui::MaterialDesignController::Initialize(); |
| 971 | 976 |
| 972 #if defined(OS_MACOSX) | 977 #if defined(OS_MACOSX) |
| 973 // The MaterialDesignController needs to look at command line flags, which | 978 // Material Design resource packs can be loaded now that command line flags |
| 974 // are not available until this point. Now that they are, proceed with | 979 // are set. See https://crbug.com/585290 . |
| 975 // (conditionally) loading the Material Design resource packs. See | |
| 976 // https://crbug.com/585290 . | |
| 977 ui::ResourceBundle::GetSharedInstance().LoadMaterialDesignResources(); | 980 ui::ResourceBundle::GetSharedInstance().LoadMaterialDesignResources(); |
| 978 #endif | 981 #endif |
| 979 | 982 |
| 980 #if defined(OS_WIN) | 983 #if defined(OS_WIN) |
| 981 // This is needed to enable ETW exporting when requested in about:flags. | 984 // This is needed to enable ETW exporting when requested in about:flags. |
| 982 // Normally, we enable it in ContentMainRunnerImpl::Initialize when the flag | 985 // Normally, we enable it in ContentMainRunnerImpl::Initialize when the flag |
| 983 // is present on the command line but flags in about:flags are converted only | 986 // is present on the command line but flags in about:flags are converted only |
| 984 // after this function runs. Note that this starts exporting later which | 987 // after this function runs. Note that this starts exporting later which |
| 985 // affects tracing the browser startup. Also, this is only relevant for the | 988 // affects tracing the browser startup. Also, this is only relevant for the |
| 986 // browser process, as other processes will get all the flags on their command | 989 // 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 Loading... |
| 1941 chromeos::CrosSettings::Shutdown(); | 1944 chromeos::CrosSettings::Shutdown(); |
| 1942 #endif // defined(OS_CHROMEOS) | 1945 #endif // defined(OS_CHROMEOS) |
| 1943 #endif // defined(OS_ANDROID) | 1946 #endif // defined(OS_ANDROID) |
| 1944 } | 1947 } |
| 1945 | 1948 |
| 1946 // Public members: | 1949 // Public members: |
| 1947 | 1950 |
| 1948 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 1951 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
| 1949 chrome_extra_parts_.push_back(parts); | 1952 chrome_extra_parts_.push_back(parts); |
| 1950 } | 1953 } |
| OLD | NEW |