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

Side by Side Diff: views/controls/menu/menu_scroll_view_container.cc

Issue 2741004: Makes it so child views of menuitemview can be traversed with the (Closed)
Patch Set: Tweaks Created 10 years, 6 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "views/controls/menu/menu_scroll_view_container.h" 5 #include "views/controls/menu/menu_scroll_view_container.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #include <uxtheme.h> 9 #include <uxtheme.h>
10 #include <Vssym32.h> 10 #include <Vssym32.h>
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 scroll_view_ = new MenuScrollView(content_view); 171 scroll_view_ = new MenuScrollView(content_view);
172 AddChildView(scroll_view_); 172 AddChildView(scroll_view_);
173 173
174 set_border(Border::CreateEmptyBorder( 174 set_border(Border::CreateEmptyBorder(
175 SubmenuView::kSubmenuBorderSize, 175 SubmenuView::kSubmenuBorderSize,
176 SubmenuView::kSubmenuBorderSize, 176 SubmenuView::kSubmenuBorderSize,
177 SubmenuView::kSubmenuBorderSize, 177 SubmenuView::kSubmenuBorderSize,
178 SubmenuView::kSubmenuBorderSize)); 178 SubmenuView::kSubmenuBorderSize));
179 } 179 }
180 180
181 void MenuScrollViewContainer::Paint(gfx::Canvas* canvas) { 181 void MenuScrollViewContainer::PaintBackground(gfx::Canvas* canvas) {
182 if (background()) {
183 View::PaintBackground(canvas);
184 return;
185 }
186
182 #if defined(OS_WIN) 187 #if defined(OS_WIN)
183 HDC dc = canvas->beginPlatformPaint(); 188 HDC dc = canvas->beginPlatformPaint();
184 RECT bounds = {0, 0, width(), height()}; 189 RECT bounds = {0, 0, width(), height()};
185 NativeTheme::instance()->PaintMenuBackground( 190 NativeTheme::instance()->PaintMenuBackground(
186 NativeTheme::MENU, dc, MENU_POPUPBACKGROUND, 0, &bounds); 191 NativeTheme::MENU, dc, MENU_POPUPBACKGROUND, 0, &bounds);
187 canvas->endPlatformPaint(); 192 canvas->endPlatformPaint();
188 #elif defined(OS_CHROMEOS) 193 #elif defined(OS_CHROMEOS)
189 static const SkColor kGradientColors[2] = { 194 static const SkColor kGradientColors[2] = {
190 SK_ColorWHITE, 195 SK_ColorWHITE,
191 SkColorSetRGB(0xF0, 0xF0, 0xF0) 196 SkColorSetRGB(0xF0, 0xF0, 0xF0)
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 } 266 }
262 267
263 bool MenuScrollViewContainer::GetAccessibleRole( 268 bool MenuScrollViewContainer::GetAccessibleRole(
264 AccessibilityTypes::Role* role) { 269 AccessibilityTypes::Role* role) {
265 DCHECK(role); 270 DCHECK(role);
266 *role = AccessibilityTypes::ROLE_MENUPOPUP; 271 *role = AccessibilityTypes::ROLE_MENUPOPUP;
267 return true; 272 return true;
268 } 273 }
269 274
270 } // namespace views 275 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698