Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1000)

Unified Diff: ui/views/controls/menu/menu_config_win.cc

Issue 851853002: It is time. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Trying to reup because the last upload failed. Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/controls/menu/menu_config_aura.cc ('k') | ui/views/controls/menu/menu_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/menu/menu_config_win.cc
diff --git a/ui/views/controls/menu/menu_config_win.cc b/ui/views/controls/menu/menu_config_win.cc
deleted file mode 100644
index 3f17f58252796e48513fa6a508e05746cbc15e03..0000000000000000000000000000000000000000
--- a/ui/views/controls/menu/menu_config_win.cc
+++ /dev/null
@@ -1,96 +0,0 @@
-// Copyright (c) 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/views/controls/menu/menu_config.h"
-
-#include <windows.h>
-#include <uxtheme.h>
-#include <Vssym32.h>
-
-#include "base/logging.h"
-#include "base/win/scoped_gdi_object.h"
-#include "base/win/win_util.h"
-#include "ui/base/l10n/l10n_util_win.h"
-#include "ui/gfx/color_utils.h"
-#include "ui/native_theme/native_theme_aura.h"
-#include "ui/native_theme/native_theme_win.h"
-
-using ui::NativeTheme;
-using ui::NativeThemeWin;
-
-namespace views {
-
-void MenuConfig::Init(const NativeTheme* theme) {
- if (theme == ui::NativeThemeAura::instance()) {
- InitAura(theme);
- return;
- }
-
- arrow_color = color_utils::GetSysSkColor(COLOR_MENUTEXT);
-
- NONCLIENTMETRICS_XP metrics;
- base::win::GetNonClientMetrics(&metrics);
- l10n_util::AdjustUIFont(&(metrics.lfMenuFont));
- {
- base::win::ScopedHFONT new_font(CreateFontIndirect(&metrics.lfMenuFont));
- DLOG_ASSERT(new_font.Get());
- font_list = gfx::FontList(gfx::Font(new_font));
- }
- NativeTheme::ExtraParams extra;
- extra.menu_check.is_radio = false;
- extra.menu_check.is_selected = false;
- gfx::Size check_size = NativeThemeWin::instance()->GetPartSize(
- NativeTheme::kMenuCheck, NativeTheme::kNormal, extra);
- if (!check_size.IsEmpty()) {
- check_width = check_size.width();
- check_height = check_size.height();
- } else {
- check_width = GetSystemMetrics(SM_CXMENUCHECK);
- check_height = GetSystemMetrics(SM_CYMENUCHECK);
- }
-
- extra.menu_check.is_radio = true;
- gfx::Size radio_size = NativeThemeWin::instance()->GetPartSize(
- NativeTheme::kMenuCheck, NativeTheme::kNormal, extra);
- if (!radio_size.IsEmpty())
- radio_width = radio_size.width();
- else
- radio_width = GetSystemMetrics(SM_CXMENUCHECK);
-
- gfx::Size arrow_size = NativeThemeWin::instance()->GetPartSize(
- NativeTheme::kMenuPopupArrow, NativeTheme::kNormal, extra);
- if (!arrow_size.IsEmpty()) {
- arrow_width = arrow_size.width();
- } else {
- // Sadly I didn't see a specify metrics for this.
- arrow_width = GetSystemMetrics(SM_CXMENUCHECK);
- }
-
- BOOL show_cues;
- show_mnemonics =
- (SystemParametersInfo(SPI_GETKEYBOARDCUES, 0, &show_cues, 0) &&
- show_cues == TRUE);
-
- SystemParametersInfo(SPI_GETMENUSHOWDELAY, 0, &show_delay, 0);
-
- separator_upper_height = 5;
- separator_lower_height = 7;
-}
-
-// static
-const MenuConfig& MenuConfig::instance(const ui::NativeTheme* theme) {
- // NOTE: |theme| may be NULL if used before the menu is running.
- if (!theme || theme == NativeThemeWin::instance()) {
- static MenuConfig* win_instance = NULL;
- if (!win_instance)
- win_instance = new MenuConfig(NativeThemeWin::instance());
- return *win_instance;
- }
- static MenuConfig* views_instance = NULL;
- if (!views_instance)
- views_instance = new MenuConfig(theme);
- return *views_instance;
-}
-
-} // namespace views
« no previous file with comments | « ui/views/controls/menu/menu_config_aura.cc ('k') | ui/views/controls/menu/menu_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698