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 "content/public/app/content_main_runner.h" | 5 #include "content/public/app/content_main_runner.h" |
| 6 | 6 |
| 7 #include <stdlib.h> | 7 #include <stdlib.h> |
| 8 | 8 |
| 9 #include "base/allocator/allocator_extension.h" | 9 #include "base/allocator/allocator_extension.h" |
| 10 #include "base/at_exit.h" | 10 #include "base/at_exit.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 71 #include "content/public/renderer/content_renderer_client.h" | 71 #include "content/public/renderer/content_renderer_client.h" |
| 72 #include "content/public/utility/content_utility_client.h" | 72 #include "content/public/utility/content_utility_client.h" |
| 73 #endif | 73 #endif |
| 74 | 74 |
| 75 #if defined(OS_WIN) | 75 #if defined(OS_WIN) |
| 76 #include <malloc.h> | 76 #include <malloc.h> |
| 77 #include <cstring> | 77 #include <cstring> |
| 78 | 78 |
| 79 #include "base/strings/string_number_conversions.h" | 79 #include "base/strings/string_number_conversions.h" |
| 80 #include "ui/base/win/atl_module.h" | 80 #include "ui/base/win/atl_module.h" |
| 81 #include "ui/base/win/dpi_setup.h" | |
| 82 #include "ui/gfx/win/dpi.h" | 81 #include "ui/gfx/win/dpi.h" |
| 83 #elif defined(OS_MACOSX) | 82 #elif defined(OS_MACOSX) |
| 84 #include "base/mac/scoped_nsautorelease_pool.h" | 83 #include "base/mac/scoped_nsautorelease_pool.h" |
| 85 #if !defined(OS_IOS) | 84 #if !defined(OS_IOS) |
| 86 #include "base/power_monitor/power_monitor_device_source.h" | 85 #include "base/power_monitor/power_monitor_device_source.h" |
| 87 #include "content/browser/mach_broker_mac.h" | 86 #include "content/browser/mach_broker_mac.h" |
| 88 #include "content/common/sandbox_init_mac.h" | 87 #include "content/common/sandbox_init_mac.h" |
| 89 #endif // !OS_IOS | 88 #endif // !OS_IOS |
| 90 #endif // OS_WIN | 89 #endif // OS_WIN |
| 91 | 90 |
| (...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 627 if (command_line.HasSwitch(switches::kDeviceScaleFactor)) { | 626 if (command_line.HasSwitch(switches::kDeviceScaleFactor)) { |
| 628 std::string scale_factor_string = command_line.GetSwitchValueASCII( | 627 std::string scale_factor_string = command_line.GetSwitchValueASCII( |
| 629 switches::kDeviceScaleFactor); | 628 switches::kDeviceScaleFactor); |
| 630 double scale_factor = 0; | 629 double scale_factor = 0; |
| 631 if (base::StringToDouble(scale_factor_string, &scale_factor)) { | 630 if (base::StringToDouble(scale_factor_string, &scale_factor)) { |
| 632 init_device_scale_factor = false; | 631 init_device_scale_factor = false; |
| 633 gfx::InitDeviceScaleFactor(scale_factor); | 632 gfx::InitDeviceScaleFactor(scale_factor); |
| 634 } | 633 } |
| 635 } | 634 } |
| 636 if (init_device_scale_factor) | 635 if (init_device_scale_factor) |
| 637 ui::win::InitDeviceScaleFactor(); | 636 gfx::InitDeviceScaleFactor(gfx::GetDPIScale()); |
|
sky
2014/10/23 04:19:13
I hate the inconsistency here. InitDeviceScaleFact
| |
| 638 #endif | 637 #endif |
| 639 | 638 |
| 640 if (!GetContentClient()) | 639 if (!GetContentClient()) |
| 641 SetContentClient(&empty_content_client_); | 640 SetContentClient(&empty_content_client_); |
| 642 ContentClientInitializer::Set(process_type, delegate_); | 641 ContentClientInitializer::Set(process_type, delegate_); |
| 643 | 642 |
| 644 #if defined(OS_WIN) | 643 #if defined(OS_WIN) |
| 645 // Route stdio to parent console (if any) or create one. | 644 // Route stdio to parent console (if any) or create one. |
| 646 if (command_line.HasSwitch(switches::kEnableLogging)) | 645 if (command_line.HasSwitch(switches::kEnableLogging)) |
| 647 base::RouteStdioToConsole(); | 646 base::RouteStdioToConsole(); |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 828 | 827 |
| 829 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); | 828 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); |
| 830 }; | 829 }; |
| 831 | 830 |
| 832 // static | 831 // static |
| 833 ContentMainRunner* ContentMainRunner::Create() { | 832 ContentMainRunner* ContentMainRunner::Create() { |
| 834 return new ContentMainRunnerImpl(); | 833 return new ContentMainRunnerImpl(); |
| 835 } | 834 } |
| 836 | 835 |
| 837 } // namespace content | 836 } // namespace content |
| OLD | NEW |