Remove some unused ui/gfx code.

BUG=NONE
R=erg@chromium.org

Review URL: https://codereview.chromium.org/978673002
diff --git a/shell/desktop/mojo_main.cc b/shell/desktop/mojo_main.cc
index b5d7e62..b45f376 100644
--- a/shell/desktop/mojo_main.cc
+++ b/shell/desktop/mojo_main.cc
@@ -18,11 +18,6 @@
 
 namespace {
 
-#if defined(OS_LINUX)
-// Copied from ui/gfx/switches.cc to avoid a dependency on //ui/gfx
-const char kEnableHarfBuzzRenderText[] = "enable-harfbuzz-rendertext";
-#endif
-
 void Usage() {
   std::cerr << "Launch Mojo applications.\n";
   std::cerr
@@ -81,14 +76,6 @@
       return 0;
     }
 
-#if defined(OS_LINUX)
-    // We use gfx::RenderText from multiple threads concurrently and the pango
-    // backend (currently the default on linux) is not close to threadsafe.
-    // Force use of the harfbuzz backend for now.
-    base::CommandLine::ForCurrentProcess()->AppendSwitch(
-        kEnableHarfBuzzRenderText);
-#endif
-
     // We want the shell::Context to outlive the MessageLoop so that pipes are
     // all gracefully closed / error-out before we try to shut the Context down.
     mojo::shell::Context shell_context;
diff --git a/ui/gfx/BUILD.gn b/ui/gfx/BUILD.gn
index 503535d..07de9ac 100644
--- a/ui/gfx/BUILD.gn
+++ b/ui/gfx/BUILD.gn
@@ -67,16 +67,12 @@
     "sequential_id_generator.h",
     "skia_util.cc",
     "skia_util.h",
-    "switches.cc",
-    "switches.h",
     "transform.cc",
     "transform.h",
     "transform_util.cc",
     "transform_util.h",
     "ui_gfx_exports.cc",
     "vsync_provider.h",
-    "win/direct_write.cc",
-    "win/direct_write.h",
     "win/hwnd_util.cc",
     "win/hwnd_util.h",
     "win/scoped_set_map_mode.h",
diff --git a/ui/gfx/display.cc b/ui/gfx/display.cc
index 3278456..80e3149 100644
--- a/ui/gfx/display.cc
+++ b/ui/gfx/display.cc
@@ -14,7 +14,6 @@
 #include "ui/gfx/point_conversions.h"
 #include "ui/gfx/point_f.h"
 #include "ui/gfx/size_conversions.h"
-#include "ui/gfx/switches.h"
 
 namespace gfx {
 namespace {
diff --git a/ui/gfx/switches.cc b/ui/gfx/switches.cc
deleted file mode 100644
index 90813d0..0000000
--- a/ui/gfx/switches.cc
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ui/gfx/switches.h"
-
-namespace switches {
-
-// Disables the HarfBuzz port of RenderText on all platforms.
-const char kDisableHarfBuzzRenderText[] = "disable-harfbuzz-rendertext";
-
-// Enables the HarfBuzz port of RenderText on all platforms.
-const char kEnableHarfBuzzRenderText[] = "enable-harfbuzz-rendertext";
-
-// Enable text glyphs to have X-positions that aren't snapped to the pixel grid
-// in webkit renderers.
-const char kEnableWebkitTextSubpixelPositioning[] =
-    "enable-webkit-text-subpixel-positioning";
-
-// Overrides the device scale factor for the browser UI and the contents.
-const char kForceDeviceScaleFactor[] = "force-device-scale-factor";
-
-#if defined(OS_WIN)
-// Disables the DirectWrite font rendering system on windows.
-const char kDisableDirectWrite[] = "disable-direct-write";
-
-// Enables DirectWrite font rendering for general UI elements.
-const char kEnableDirectWriteForUI[] = "enable-directwrite-for-ui";
-#endif
-
-}  // namespace switches
diff --git a/ui/gfx/switches.h b/ui/gfx/switches.h
deleted file mode 100644
index e85dabf..0000000
--- a/ui/gfx/switches.h
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef UI_GFX_SWITCHES_H_
-#define UI_GFX_SWITCHES_H_
-
-#include "build/build_config.h"
-#include "ui/gfx/gfx_export.h"
-
-namespace switches {
-
-GFX_EXPORT extern const char kAllowArbitraryScaleFactorInImageSkia[];
-GFX_EXPORT extern const char kDisableHarfBuzzRenderText[];
-GFX_EXPORT extern const char kEnableHarfBuzzRenderText[];
-GFX_EXPORT extern const char kEnableWebkitTextSubpixelPositioning[];
-GFX_EXPORT extern const char kForceDeviceScaleFactor[];
-
-#if defined(OS_WIN)
-GFX_EXPORT extern const char kDisableDirectWrite[];
-GFX_EXPORT extern const char kEnableDirectWriteForUI[];
-#endif
-
-}  // namespace switches
-
-#endif  // UI_GFX_SWITCHES_H_
diff --git a/ui/gfx/win/direct_write.cc b/ui/gfx/win/direct_write.cc
deleted file mode 100644
index 058f4be..0000000
--- a/ui/gfx/win/direct_write.cc
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ui/gfx/win/direct_write.h"
-
-#include "base/basictypes.h"
-#include "base/command_line.h"
-#include "base/metrics/field_trial.h"
-#include "base/win/registry.h"
-#include "base/win/windows_version.h"
-#include "ui/gfx/switches.h"
-#include "ui/gfx/win/dpi.h"
-
-namespace gfx {
-namespace win {
-
-bool ShouldUseDirectWrite() {
-  // If the flag is currently on, and we're on Win7 or above, we enable
-  // DirectWrite. Skia does not require the additions to DirectWrite in QFE
-  // 2670838, but a simple 'better than XP' check is not enough.
-  if (base::win::GetVersion() < base::win::VERSION_WIN7)
-    return false;
-
-  base::win::OSInfo::VersionNumber os_version =
-      base::win::OSInfo::GetInstance()->version_number();
-  if ((os_version.major == 6) && (os_version.minor == 1)) {
-    // We can't use DirectWrite for pre-release versions of Windows 7.
-    if (os_version.build < 7600)
-      return false;
-  }
-  // If forced off, don't use it.
-  const base::CommandLine& command_line =
-      *base::CommandLine::ForCurrentProcess();
-  if (command_line.HasSwitch(switches::kDisableDirectWrite))
-    return false;
-
-  // Can't use GDI on HiDPI.
-  if (gfx::GetDPIScale() > 1.0f)
-    return true;
-
-  // We have logic in renderer_font_platform_win.cc for falling back to safe
-  // font list if machine has more than 1750 fonts installed. Users have
-  // complained about this as safe font list is usually not sufficient.
-  // We now disable direct write (gdi) if we encounter more number
-  // of fonts than a threshold (currently 1750).
-  // Refer: crbug.com/421305
-  const wchar_t kWindowsFontsRegistryKey[] =
-      L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts";
-  base::win::RegistryValueIterator reg_iterator(HKEY_LOCAL_MACHINE,
-                                                kWindowsFontsRegistryKey);
-  const DWORD kMaxAllowedFontsBeforeFallbackToGDI = 1750;
-  if (reg_iterator.ValueCount() >= kMaxAllowedFontsBeforeFallbackToGDI)
-    return false;
-
-  // Otherwise, check the field trial.
-  const std::string group_name =
-      base::FieldTrialList::FindFullName("DirectWrite");
-  return group_name != "Disabled";
-}
-
-}  // namespace win
-}  // namespace gfx
diff --git a/ui/gfx/win/direct_write.h b/ui/gfx/win/direct_write.h
deleted file mode 100644
index b621bf8..0000000
--- a/ui/gfx/win/direct_write.h
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef UI_GFX_WIN_DIRECT_WRITE_H_
-#define UI_GFX_WIN_DIRECT_WRITE_H_
-
-#include "ui/gfx/gfx_export.h"
-
-namespace gfx {
-namespace win {
-
-// Returns whether DirectWrite font rendering should be used.
-GFX_EXPORT bool ShouldUseDirectWrite();
-
-}  // namespace win
-}  // namespace gfx
-
-#endif  // UI_GFX_WIN_DIRECT_WRITE_H_