OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 |
OLD | NEW |