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: content/app/content_main_runner.cc

Issue 659883002: Enable hidpi on Linux, refactor a bit on Windows to share Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: constants Created 6 years, 2 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 "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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 #include "content/public/common/sandbox_init.h" 42 #include "content/public/common/sandbox_init.h"
43 #include "content/renderer/in_process_renderer_thread.h" 43 #include "content/renderer/in_process_renderer_thread.h"
44 #include "content/utility/in_process_utility_thread.h" 44 #include "content/utility/in_process_utility_thread.h"
45 #include "crypto/nss_util.h" 45 #include "crypto/nss_util.h"
46 #include "ipc/ipc_descriptors.h" 46 #include "ipc/ipc_descriptors.h"
47 #include "ipc/ipc_switches.h" 47 #include "ipc/ipc_switches.h"
48 #include "media/base/media.h" 48 #include "media/base/media.h"
49 #include "sandbox/win/src/sandbox_types.h" 49 #include "sandbox/win/src/sandbox_types.h"
50 #include "ui/base/ui_base_paths.h" 50 #include "ui/base/ui_base_paths.h"
51 #include "ui/base/ui_base_switches.h" 51 #include "ui/base/ui_base_switches.h"
52 #include "ui/gfx/dpi.h"
52 53
53 #if defined(OS_ANDROID) 54 #if defined(OS_ANDROID)
54 #include "content/public/common/content_descriptors.h" 55 #include "content/public/common/content_descriptors.h"
55 #endif 56 #endif
56 57
57 #if defined(USE_TCMALLOC) 58 #if defined(USE_TCMALLOC)
58 #include "third_party/tcmalloc/chromium/src/gperftools/malloc_extension.h" 59 #include "third_party/tcmalloc/chromium/src/gperftools/malloc_extension.h"
59 #if defined(TYPE_PROFILING) 60 #if defined(TYPE_PROFILING)
60 #include "base/allocator/type_profiler.h" 61 #include "base/allocator/type_profiler.h"
61 #include "base/allocator/type_profiler_tcmalloc.h" 62 #include "base/allocator/type_profiler_tcmalloc.h"
62 #endif 63 #endif
63 #endif 64 #endif
64 65
65 #if !defined(OS_IOS) 66 #if !defined(OS_IOS)
66 #include "content/app/mojo/mojo_init.h" 67 #include "content/app/mojo/mojo_init.h"
67 #include "content/browser/gpu/gpu_process_host.h" 68 #include "content/browser/gpu/gpu_process_host.h"
68 #include "content/browser/renderer_host/render_process_host_impl.h" 69 #include "content/browser/renderer_host/render_process_host_impl.h"
69 #include "content/browser/utility_process_host_impl.h" 70 #include "content/browser/utility_process_host_impl.h"
70 #include "content/public/plugin/content_plugin_client.h" 71 #include "content/public/plugin/content_plugin_client.h"
71 #include "content/public/renderer/content_renderer_client.h" 72 #include "content/public/renderer/content_renderer_client.h"
72 #include "content/public/utility/content_utility_client.h" 73 #include "content/public/utility/content_utility_client.h"
73 #endif 74 #endif
74 75
75 #if defined(OS_WIN) 76 #if defined(OS_WIN)
76 #include <malloc.h> 77 #include <malloc.h>
77 #include <cstring> 78 #include <cstring>
78 79
79 #include "base/strings/string_number_conversions.h" 80 #include "base/strings/string_number_conversions.h"
80 #include "ui/base/win/atl_module.h" 81 #include "ui/base/win/atl_module.h"
81 #include "ui/base/win/dpi_setup.h"
82 #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
92 #if defined(OS_POSIX) 91 #if defined(OS_POSIX)
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
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());
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698