| 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/browser/browser_main_runner.h" | 5 #include "content/public/browser/browser_main_runner.h" |
| 6 | 6 |
| 7 #include "base/allocator/allocator_shim.h" | 7 #include "base/allocator/allocator_shim.h" |
| 8 #include "base/base_switches.h" | 8 #include "base/base_switches.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/leak_annotations.h" | 10 #include "base/debug/leak_annotations.h" |
| 11 #include "base/debug/trace_event.h" | 11 #include "base/debug/trace_event.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
| 14 #include "base/metrics/statistics_recorder.h" | 14 #include "base/metrics/statistics_recorder.h" |
| 15 #include "content/browser/browser_main_loop.h" | 15 #include "content/browser/browser_main_loop.h" |
| 16 #include "content/browser/browser_shutdown_profile_dumper.h" | 16 #include "content/browser/browser_shutdown_profile_dumper.h" |
| 17 #include "content/browser/notification_service_impl.h" | 17 #include "content/browser/notification_service_impl.h" |
| 18 #include "content/public/common/content_switches.h" | 18 #include "content/public/common/content_switches.h" |
| 19 #include "content/public/common/main_function_params.h" | 19 #include "content/public/common/main_function_params.h" |
| 20 #include "ui/base/ime/input_method_initializer.h" | 20 #include "ui/base/ime/input_method_initializer.h" |
| 21 | 21 |
| 22 #if defined(OS_WIN) | 22 #if defined(OS_WIN) |
| 23 #include <dwrite.h> |
| 23 #include "base/win/win_util.h" | 24 #include "base/win/win_util.h" |
| 24 #include "base/win/windows_version.h" | 25 #include "base/win/windows_version.h" |
| 25 #include "net/cert/sha256_legacy_support_win.h" | 26 #include "net/cert/sha256_legacy_support_win.h" |
| 26 #include "sandbox/win/src/sidestep/preamble_patcher.h" | 27 #include "sandbox/win/src/sidestep/preamble_patcher.h" |
| 27 #include "skia/ext/fontmgr_default_win.h" | 28 #include "skia/ext/fontmgr_default_win.h" |
| 28 #include "third_party/skia/include/ports/SkFontMgr.h" | 29 #include "third_party/skia/include/ports/SkFontMgr.h" |
| 29 #include "third_party/skia/include/ports/SkTypeface_win.h" | 30 #include "third_party/skia/include/ports/SkTypeface_win.h" |
| 30 #include "ui/base/win/scoped_ole_initializer.h" | 31 #include "ui/base/win/scoped_ole_initializer.h" |
| 31 #include "ui/gfx/platform_font_win.h" | 32 #include "ui/gfx/platform_font_win.h" |
| 32 #include "ui/gfx/switches.h" | 33 #include "ui/gfx/switches.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 // Not finding the DWriteCreateFactory function indicates a corrupt dll. | 134 // Not finding the DWriteCreateFactory function indicates a corrupt dll. |
| 134 CHECK(dwrite_create_factory_proc); | 135 CHECK(dwrite_create_factory_proc); |
| 135 | 136 |
| 136 IDWriteFactory* factory = NULL; | 137 IDWriteFactory* factory = NULL; |
| 137 | 138 |
| 138 CHECK(SUCCEEDED( | 139 CHECK(SUCCEEDED( |
| 139 dwrite_create_factory_proc(DWRITE_FACTORY_TYPE_SHARED, | 140 dwrite_create_factory_proc(DWRITE_FACTORY_TYPE_SHARED, |
| 140 __uuidof(IDWriteFactory), | 141 __uuidof(IDWriteFactory), |
| 141 reinterpret_cast<IUnknown**>(&factory)))); | 142 reinterpret_cast<IUnknown**>(&factory)))); |
| 142 SetDefaultSkiaFactory(SkFontMgr_New_DirectWrite(factory)); | 143 SetDefaultSkiaFactory(SkFontMgr_New_DirectWrite(factory)); |
| 143 gfx::PlatformFontWin::set_direct_write_factory(factory); | 144 gfx::PlatformFontWin::set_use_skia_for_font_metrics(true); |
| 144 } | 145 } |
| 145 } | 146 } |
| 146 | 147 |
| 147 } // namespace | 148 } // namespace |
| 148 | 149 |
| 149 #endif // OS_WIN | 150 #endif // OS_WIN |
| 150 | 151 |
| 151 class BrowserMainRunnerImpl : public BrowserMainRunner { | 152 class BrowserMainRunnerImpl : public BrowserMainRunner { |
| 152 public: | 153 public: |
| 153 BrowserMainRunnerImpl() | 154 BrowserMainRunnerImpl() |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 | 318 |
| 318 DISALLOW_COPY_AND_ASSIGN(BrowserMainRunnerImpl); | 319 DISALLOW_COPY_AND_ASSIGN(BrowserMainRunnerImpl); |
| 319 }; | 320 }; |
| 320 | 321 |
| 321 // static | 322 // static |
| 322 BrowserMainRunner* BrowserMainRunner::Create() { | 323 BrowserMainRunner* BrowserMainRunner::Create() { |
| 323 return new BrowserMainRunnerImpl(); | 324 return new BrowserMainRunnerImpl(); |
| 324 } | 325 } |
| 325 | 326 |
| 326 } // namespace content | 327 } // namespace content |
| OLD | NEW |