| 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 "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "third_party/skia/include/core/SkPaint.h" | 9 #include "third_party/skia/include/core/SkPaint.h" |
| 10 #include "third_party/skia/include/core/SkPath.h" | 10 #include "third_party/skia/include/core/SkPath.h" |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 const MenuConfig& menu_config = MenuConfig::instance(); | 253 const MenuConfig& menu_config = MenuConfig::instance(); |
| 254 extra.menu_background.corner_radius = menu_config.corner_radius; | 254 extra.menu_background.corner_radius = menu_config.corner_radius; |
| 255 GetNativeTheme()->Paint(canvas->sk_canvas(), | 255 GetNativeTheme()->Paint(canvas->sk_canvas(), |
| 256 NativeTheme::kMenuPopupBackground, NativeTheme::kNormal, bounds, extra); | 256 NativeTheme::kMenuPopupBackground, NativeTheme::kNormal, bounds, extra); |
| 257 } | 257 } |
| 258 | 258 |
| 259 void MenuScrollViewContainer::GetAccessibleState( | 259 void MenuScrollViewContainer::GetAccessibleState( |
| 260 ui::AXViewState* state) { | 260 ui::AXViewState* state) { |
| 261 // Get the name from the submenu view. | 261 // Get the name from the submenu view. |
| 262 content_view_->GetAccessibleState(state); | 262 content_view_->GetAccessibleState(state); |
| 263 | |
| 264 // Now change the role. | |
| 265 state->role = ui::AX_ROLE_MENU_BAR; | 263 state->role = ui::AX_ROLE_MENU_BAR; |
| 266 } | 264 } |
| 267 | 265 |
| 268 void MenuScrollViewContainer::OnBoundsChanged( | 266 void MenuScrollViewContainer::OnBoundsChanged( |
| 269 const gfx::Rect& previous_bounds) { | 267 const gfx::Rect& previous_bounds) { |
| 270 gfx::Size content_pref = scroll_view_->GetContents()->GetPreferredSize(); | 268 gfx::Size content_pref = scroll_view_->GetContents()->GetPreferredSize(); |
| 271 scroll_up_button_->SetVisible(content_pref.height() > height()); | 269 scroll_up_button_->SetVisible(content_pref.height() > height()); |
| 272 scroll_down_button_->SetVisible(content_pref.height() > height()); | 270 scroll_down_button_->SetVisible(content_pref.height() > height()); |
| 273 Layout(); | 271 Layout(); |
| 274 } | 272 } |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 case MENU_ANCHOR_BUBBLE_ABOVE: | 318 case MENU_ANCHOR_BUBBLE_ABOVE: |
| 321 return BubbleBorder::BOTTOM_CENTER; | 319 return BubbleBorder::BOTTOM_CENTER; |
| 322 case MENU_ANCHOR_BUBBLE_BELOW: | 320 case MENU_ANCHOR_BUBBLE_BELOW: |
| 323 return BubbleBorder::TOP_CENTER; | 321 return BubbleBorder::TOP_CENTER; |
| 324 default: | 322 default: |
| 325 return BubbleBorder::NONE; | 323 return BubbleBorder::NONE; |
| 326 } | 324 } |
| 327 } | 325 } |
| 328 | 326 |
| 329 } // namespace views | 327 } // namespace views |
| OLD | NEW |