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/base/accessibility/accessible_view_state.h" | 9 #include "ui/base/accessibility/accessible_view_state.h" |
10 #include "ui/gfx/canvas.h" | 10 #include "ui/gfx/canvas.h" |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 new views::RoundRectPainter(menu_config.native_theme->GetSystemColor( | 282 new views::RoundRectPainter(menu_config.native_theme->GetSystemColor( |
283 ui::NativeTheme::kColorId_MenuBorderColor), | 283 ui::NativeTheme::kColorId_MenuBorderColor), |
284 menu_config.corner_radius), | 284 menu_config.corner_radius), |
285 gfx::Insets(top, left, bottom, right))); | 285 gfx::Insets(top, left, bottom, right))); |
286 } else { | 286 } else { |
287 set_border(Border::CreateEmptyBorder(top, left, bottom, right)); | 287 set_border(Border::CreateEmptyBorder(top, left, bottom, right)); |
288 } | 288 } |
289 } | 289 } |
290 | 290 |
291 void MenuScrollViewContainer::CreateBubbleBorder() { | 291 void MenuScrollViewContainer::CreateBubbleBorder() { |
292 bubble_border_ = new BubbleBorder( | 292 bubble_border_ = |
293 arrow_location_, | 293 new BubbleBorder(arrow_location_, BubbleBorder::NO_SHADOW, SK_ColorWHITE); |
294 BubbleBorder::NO_SHADOW); | |
295 set_border(bubble_border_); | 294 set_border(bubble_border_); |
296 set_background(new BubbleBackground(bubble_border_)); | 295 set_background(new BubbleBackground(bubble_border_)); |
297 } | 296 } |
298 | 297 |
299 BubbleBorder::ArrowLocation | 298 BubbleBorder::ArrowLocation |
300 MenuScrollViewContainer::BubbleBorderTypeFromAnchor( | 299 MenuScrollViewContainer::BubbleBorderTypeFromAnchor( |
301 MenuItemView::AnchorPosition anchor) { | 300 MenuItemView::AnchorPosition anchor) { |
302 switch (anchor) { | 301 switch (anchor) { |
303 case views::MenuItemView::BUBBLE_LEFT: | 302 case views::MenuItemView::BUBBLE_LEFT: |
304 return BubbleBorder::RIGHT_CENTER; | 303 return BubbleBorder::RIGHT_CENTER; |
305 case views::MenuItemView::BUBBLE_RIGHT: | 304 case views::MenuItemView::BUBBLE_RIGHT: |
306 return BubbleBorder::LEFT_CENTER; | 305 return BubbleBorder::LEFT_CENTER; |
307 case views::MenuItemView::BUBBLE_ABOVE: | 306 case views::MenuItemView::BUBBLE_ABOVE: |
308 return BubbleBorder::BOTTOM_CENTER; | 307 return BubbleBorder::BOTTOM_CENTER; |
309 case views::MenuItemView::BUBBLE_BELOW: | 308 case views::MenuItemView::BUBBLE_BELOW: |
310 return BubbleBorder::TOP_CENTER; | 309 return BubbleBorder::TOP_CENTER; |
311 default: | 310 default: |
312 return BubbleBorder::NONE; | 311 return BubbleBorder::NONE; |
313 } | 312 } |
314 } | 313 } |
315 | 314 |
316 } // namespace views | 315 } // namespace views |
OLD | NEW |