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

Unified Diff: ui/views/controls/menu/menu_separator_views.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_separator.h ('k') | ui/views/controls/menu/menu_separator_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/menu/menu_separator_views.cc
diff --git a/ui/views/controls/menu/menu_separator_views.cc b/ui/views/controls/menu/menu_separator_views.cc
deleted file mode 100644
index cf5a8fbbf85046bcbe1eefadf089c9af435589f7..0000000000000000000000000000000000000000
--- a/ui/views/controls/menu/menu_separator_views.cc
+++ /dev/null
@@ -1,72 +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_separator.h"
-
-#include "third_party/skia/include/core/SkColor.h"
-#include "ui/gfx/canvas.h"
-#include "ui/native_theme/native_theme.h"
-#include "ui/views/controls/menu/menu_config.h"
-#include "ui/views/controls/menu/menu_item_view.h"
-
-namespace {
-
-const int kSeparatorHeight = 1;
-
-} // namespace
-
-namespace views {
-
-#if !defined(OS_WIN)
-void MenuSeparator::OnPaint(gfx::Canvas* canvas) {
- OnPaintAura(canvas);
-}
-#endif
-
-gfx::Size MenuSeparator::GetPreferredSize() const {
- const MenuConfig& menu_config = parent_menu_item_->GetMenuConfig();
- int height = menu_config.separator_height;
- switch(type_) {
- case ui::SPACING_SEPARATOR:
- height = menu_config.separator_spacing_height;
- break;
- case ui::LOWER_SEPARATOR:
- height = menu_config.separator_lower_height;
- break;
- case ui::UPPER_SEPARATOR:
- height = menu_config.separator_upper_height;
- break;
- default:
- height = menu_config.separator_height;
- break;
- }
- return gfx::Size(10, // Just in case we're the only item in a menu.
- height);
-}
-
-gfx::Rect MenuSeparator::GetPaintBounds() {
- int pos = 0;
- switch (type_) {
- case ui::LOWER_SEPARATOR:
- pos = height() - kSeparatorHeight;
- break;
- case ui::SPACING_SEPARATOR:
- return gfx::Rect();
- case ui::UPPER_SEPARATOR:
- break;
- default:
- pos = height() / 2;
- break;
- }
-
- return gfx::Rect(0, pos, width(), kSeparatorHeight);
-}
-
-void MenuSeparator::OnPaintAura(gfx::Canvas* canvas) {
- canvas->FillRect(GetPaintBounds(),
- GetNativeTheme()->GetSystemColor(
- ui::NativeTheme::kColorId_MenuSeparatorColor));
-}
-
-} // namespace views
« no previous file with comments | « ui/views/controls/menu/menu_separator.h ('k') | ui/views/controls/menu/menu_separator_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698