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

Side by Side Diff: ui/views/controls/menu/menu_separator_win.cc

Issue 273223002: views: Make view::Views::GetPreferredSize() const. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More compile fix for ToT Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « ui/views/controls/menu/menu_separator_views.cc ('k') | ui/views/controls/menu/submenu_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ui/views/controls/menu/menu_separator.h" 5 #include "ui/views/controls/menu/menu_separator.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <uxtheme.h> 8 #include <uxtheme.h>
9 #include <Vssym32.h> 9 #include <Vssym32.h>
10 10
(...skipping 29 matching lines...) Expand all
40 } 40 }
41 41
42 gfx::Rect separator_bounds(start_x, 0, width(), height()); 42 gfx::Rect separator_bounds(start_x, 0, width(), height());
43 ui::NativeTheme::ExtraParams extra; 43 ui::NativeTheme::ExtraParams extra;
44 extra.menu_separator.has_gutter = config.render_gutter; 44 extra.menu_separator.has_gutter = config.render_gutter;
45 config.native_theme->Paint( 45 config.native_theme->Paint(
46 canvas->sk_canvas(), ui::NativeTheme::kMenuPopupSeparator, 46 canvas->sk_canvas(), ui::NativeTheme::kMenuPopupSeparator,
47 ui::NativeTheme::kNormal, separator_bounds, extra); 47 ui::NativeTheme::kNormal, separator_bounds, extra);
48 } 48 }
49 49
50 gfx::Size MenuSeparator::GetPreferredSize() { 50 gfx::Size MenuSeparator::GetPreferredSize() const {
51 const MenuConfig& config = parent_menu_item_->GetMenuConfig(); 51 const MenuConfig& config = parent_menu_item_->GetMenuConfig();
52 52
53 if (config.native_theme == ui::NativeThemeAura::instance()) 53 if (config.native_theme == ui::NativeThemeAura::instance())
54 return GetPreferredSizeAura(); 54 return GetPreferredSizeAura();
55 55
56 return gfx::Size(10, // Just in case we're the only item in a menu. 56 return gfx::Size(10, // Just in case we're the only item in a menu.
57 config.separator_height); 57 config.separator_height);
58 } 58 }
59 59
60 } // namespace views 60 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/menu/menu_separator_views.cc ('k') | ui/views/controls/menu/submenu_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698