Chromium Code Reviews| 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/service/service_process.h" | 5 #include "chrome/service/service_process.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 32 #include "chrome/grit/chromium_strings.h" | 32 #include "chrome/grit/chromium_strings.h" |
| 33 #include "chrome/grit/generated_resources.h" | 33 #include "chrome/grit/generated_resources.h" |
| 34 #include "chrome/service/cloud_print/cloud_print_message_handler.h" | 34 #include "chrome/service/cloud_print/cloud_print_message_handler.h" |
| 35 #include "chrome/service/cloud_print/cloud_print_proxy.h" | 35 #include "chrome/service/cloud_print/cloud_print_proxy.h" |
| 36 #include "chrome/service/net/service_url_request_context_getter.h" | 36 #include "chrome/service/net/service_url_request_context_getter.h" |
| 37 #include "chrome/service/service_process_prefs.h" | 37 #include "chrome/service/service_process_prefs.h" |
| 38 #include "components/prefs/json_pref_store.h" | 38 #include "components/prefs/json_pref_store.h" |
| 39 #include "net/base/network_change_notifier.h" | 39 #include "net/base/network_change_notifier.h" |
| 40 #include "net/url_request/url_fetcher.h" | 40 #include "net/url_request/url_fetcher.h" |
| 41 #include "ui/base/l10n/l10n_util.h" | 41 #include "ui/base/l10n/l10n_util.h" |
| 42 #include "ui/base/material_design/material_design_controller.h" | |
| 42 #include "ui/base/resource/resource_bundle.h" | 43 #include "ui/base/resource/resource_bundle.h" |
| 43 #include "ui/base/ui_base_switches.h" | 44 #include "ui/base/ui_base_switches.h" |
| 44 | 45 |
| 45 #if defined(USE_GLIB) | 46 #if defined(USE_GLIB) |
| 46 #include <glib-object.h> | 47 #include <glib-object.h> |
| 47 #endif | 48 #endif |
| 48 | 49 |
| 49 ServiceProcess* g_service_process = NULL; | 50 ServiceProcess* g_service_process = NULL; |
| 50 | 51 |
| 51 namespace { | 52 namespace { |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 173 service_prefs_->WritePrefs(); | 174 service_prefs_->WritePrefs(); |
| 174 } else { | 175 } else { |
| 175 // If no command-line value was specified, read the last used locale from | 176 // If no command-line value was specified, read the last used locale from |
| 176 // the prefs. | 177 // the prefs. |
| 177 locale = | 178 locale = |
| 178 service_prefs_->GetString(prefs::kApplicationLocale, std::string()); | 179 service_prefs_->GetString(prefs::kApplicationLocale, std::string()); |
| 179 // If no locale was specified anywhere, use the default one. | 180 // If no locale was specified anywhere, use the default one. |
| 180 if (locale.empty()) | 181 if (locale.empty()) |
| 181 locale = kDefaultServiceProcessLocale; | 182 locale = kDefaultServiceProcessLocale; |
| 182 } | 183 } |
| 184 ui::MaterialDesignController::Initialize(); | |
|
sky
2016/04/11 15:32:40
Why does the service process need material design?
varkha
2016/04/11 19:30:58
InitSharedInstanceWithLocale below (inside Resourc
| |
| 183 ui::ResourceBundle::InitSharedInstanceWithLocale( | 185 ui::ResourceBundle::InitSharedInstanceWithLocale( |
| 184 locale, NULL, ui::ResourceBundle::LOAD_COMMON_RESOURCES); | 186 locale, NULL, ui::ResourceBundle::LOAD_COMMON_RESOURCES); |
| 185 | 187 |
| 186 PrepareRestartOnCrashEnviroment(command_line); | 188 PrepareRestartOnCrashEnviroment(command_line); |
| 187 | 189 |
| 188 // Enable Cloud Print if needed. First check the command-line. | 190 // Enable Cloud Print if needed. First check the command-line. |
| 189 // Then check if the cloud print proxy was previously enabled. | 191 // Then check if the cloud print proxy was previously enabled. |
| 190 if (command_line.HasSwitch(switches::kEnableCloudPrintProxy) || | 192 if (command_line.HasSwitch(switches::kEnableCloudPrintProxy) || |
| 191 service_prefs_->GetBoolean(prefs::kCloudPrintProxyEnabled, false)) { | 193 service_prefs_->GetBoolean(prefs::kCloudPrintProxyEnabled, false)) { |
| 192 GetCloudPrintProxy()->EnableForUser(); | 194 GetCloudPrintProxy()->EnableForUser(); |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 363 } else { | 365 } else { |
| 364 Shutdown(); | 366 Shutdown(); |
| 365 } | 367 } |
| 366 } | 368 } |
| 367 } | 369 } |
| 368 | 370 |
| 369 ServiceProcess::~ServiceProcess() { | 371 ServiceProcess::~ServiceProcess() { |
| 370 Teardown(); | 372 Teardown(); |
| 371 g_service_process = NULL; | 373 g_service_process = NULL; |
| 372 } | 374 } |
| OLD | NEW |