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

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

Issue 243633003: use the right NativeTheme on bubbles + dialogs on Aura Linux (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: good enough for now Created 6 years, 8 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
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_scroll_view_container.h" 5 #include "ui/views/controls/menu/menu_scroll_view_container.h"
6 6
7 #include "third_party/skia/include/core/SkPaint.h" 7 #include "third_party/skia/include/core/SkPaint.h"
8 #include "third_party/skia/include/core/SkPath.h" 8 #include "third_party/skia/include/core/SkPath.h"
9 #include "ui/accessibility/ax_view_state.h" 9 #include "ui/accessibility/ax_view_state.h"
10 #include "ui/gfx/canvas.h" 10 #include "ui/gfx/canvas.h"
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 arrow_ = BubbleBorder::NONE; 274 arrow_ = BubbleBorder::NONE;
275 bubble_border_ = NULL; 275 bubble_border_ = NULL;
276 276
277 const MenuConfig& menu_config = 277 const MenuConfig& menu_config =
278 content_view_->GetMenuItem()->GetMenuConfig(); 278 content_view_->GetMenuItem()->GetMenuConfig();
279 279
280 bool use_border = true; 280 bool use_border = true;
281 int padding = menu_config.corner_radius > 0 ? 281 int padding = menu_config.corner_radius > 0 ?
282 kBorderPaddingDueToRoundedCorners : 0; 282 kBorderPaddingDueToRoundedCorners : 0;
283 283
284 #if !(defined(OS_LINUX) && !defined(OS_CHROMEOS))
Elliot Glaysher 2014/04/21 22:43:20 If you're bracing these with #if checks, you proba
Evan Stade 2014/04/22 18:33:22 No, I think menu_config_views.cc is OK as-is. I ju
Elliot Glaysher 2014/04/22 19:48:27 I can see us wanting to use the aura colors. Howev
284 if (menu_config.native_theme == ui::NativeThemeAura::instance()) { 285 if (menu_config.native_theme == ui::NativeThemeAura::instance()) {
285 // In case of NativeThemeAura the border gets drawn with the shadow. 286 // In case of NativeThemeAura the border gets drawn with the shadow.
286 // Furthermore no additional padding is wanted. 287 // Furthermore no additional padding is wanted.
287 use_border = false; 288 use_border = false;
288 padding = 0; 289 padding = 0;
289 } 290 }
291 #endif
290 292
291 int top = menu_config.menu_vertical_border_size + padding; 293 int top = menu_config.menu_vertical_border_size + padding;
292 int left = menu_config.menu_horizontal_border_size + padding; 294 int left = menu_config.menu_horizontal_border_size + padding;
293 int bottom = menu_config.menu_vertical_border_size + padding; 295 int bottom = menu_config.menu_vertical_border_size + padding;
294 int right = menu_config.menu_horizontal_border_size + padding; 296 int right = menu_config.menu_horizontal_border_size + padding;
295 297
296 if (use_border) { 298 if (use_border) {
297 SetBorder(views::Border::CreateBorderPainter( 299 SetBorder(views::Border::CreateBorderPainter(
298 new views::RoundRectPainter( 300 new views::RoundRectPainter(
299 menu_config.native_theme->GetSystemColor( 301 menu_config.native_theme->GetSystemColor(
(...skipping 24 matching lines...) Expand all
324 case views::MenuItemView::BUBBLE_ABOVE: 326 case views::MenuItemView::BUBBLE_ABOVE:
325 return BubbleBorder::BOTTOM_CENTER; 327 return BubbleBorder::BOTTOM_CENTER;
326 case views::MenuItemView::BUBBLE_BELOW: 328 case views::MenuItemView::BUBBLE_BELOW:
327 return BubbleBorder::TOP_CENTER; 329 return BubbleBorder::TOP_CENTER;
328 default: 330 default:
329 return BubbleBorder::NONE; 331 return BubbleBorder::NONE;
330 } 332 }
331 } 333 }
332 334
333 } // namespace views 335 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698