| 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 #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> |
| 11 #endif | 11 #endif |
| 12 | 12 |
| 13 #include "ui/base/accessibility/accessible_view_state.h" | 13 #include "ui/base/accessibility/accessible_view_state.h" |
| 14 #include "ui/base/native_theme/native_theme.h" | |
| 15 #include "ui/gfx/canvas.h" | 14 #include "ui/gfx/canvas.h" |
| 16 #include "ui/gfx/color_utils.h" | 15 #include "ui/gfx/color_utils.h" |
| 16 #include "ui/gfx/native_theme.h" |
| 17 #include "ui/views/border.h" | 17 #include "ui/views/border.h" |
| 18 #include "ui/views/controls/menu/menu_config.h" | 18 #include "ui/views/controls/menu/menu_config.h" |
| 19 #include "ui/views/controls/menu/menu_controller.h" | 19 #include "ui/views/controls/menu/menu_controller.h" |
| 20 #include "ui/views/controls/menu/menu_item_view.h" | 20 #include "ui/views/controls/menu/menu_item_view.h" |
| 21 #include "ui/views/controls/menu/submenu_view.h" | 21 #include "ui/views/controls/menu/submenu_view.h" |
| 22 | 22 |
| 23 using ui::NativeTheme; | 23 using gfx::NativeTheme; |
| 24 | 24 |
| 25 // Height of the scroll arrow. | 25 // Height of the scroll arrow. |
| 26 // This goes up to 4 with large fonts, but this is close enough for now. | 26 // This goes up to 4 with large fonts, but this is close enough for now. |
| 27 static const int scroll_arrow_height = 3; | 27 static const int scroll_arrow_height = 3; |
| 28 | 28 |
| 29 namespace views { | 29 namespace views { |
| 30 | 30 |
| 31 namespace { | 31 namespace { |
| 32 | 32 |
| 33 // MenuScrollButton ------------------------------------------------------------ | 33 // MenuScrollButton ------------------------------------------------------------ |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 | 238 |
| 239 void MenuScrollViewContainer::OnBoundsChanged( | 239 void MenuScrollViewContainer::OnBoundsChanged( |
| 240 const gfx::Rect& previous_bounds) { | 240 const gfx::Rect& previous_bounds) { |
| 241 gfx::Size content_pref = scroll_view_->GetContents()->GetPreferredSize(); | 241 gfx::Size content_pref = scroll_view_->GetContents()->GetPreferredSize(); |
| 242 scroll_up_button_->SetVisible(content_pref.height() > height()); | 242 scroll_up_button_->SetVisible(content_pref.height() > height()); |
| 243 scroll_down_button_->SetVisible(content_pref.height() > height()); | 243 scroll_down_button_->SetVisible(content_pref.height() > height()); |
| 244 Layout(); | 244 Layout(); |
| 245 } | 245 } |
| 246 | 246 |
| 247 } // namespace views | 247 } // namespace views |
| OLD | NEW |