OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "views/controls/menu/menu_scroll_view_container.h" | 5 #include "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> |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 | 250 |
251 scroll_view_->SetBounds(x, scroll_view_y, width, content_height); | 251 scroll_view_->SetBounds(x, scroll_view_y, width, content_height); |
252 scroll_view_->Layout(); | 252 scroll_view_->Layout(); |
253 } | 253 } |
254 | 254 |
255 void MenuScrollViewContainer::DidChangeBounds(const gfx::Rect& previous, | 255 void MenuScrollViewContainer::DidChangeBounds(const gfx::Rect& previous, |
256 const gfx::Rect& current) { | 256 const gfx::Rect& current) { |
257 gfx::Size content_pref = scroll_view_->GetContents()->GetPreferredSize(); | 257 gfx::Size content_pref = scroll_view_->GetContents()->GetPreferredSize(); |
258 scroll_up_button_->SetVisible(content_pref.height() > height()); | 258 scroll_up_button_->SetVisible(content_pref.height() > height()); |
259 scroll_down_button_->SetVisible(content_pref.height() > height()); | 259 scroll_down_button_->SetVisible(content_pref.height() > height()); |
| 260 Layout(); |
260 } | 261 } |
261 | 262 |
262 gfx::Size MenuScrollViewContainer::GetPreferredSize() { | 263 gfx::Size MenuScrollViewContainer::GetPreferredSize() { |
263 gfx::Size prefsize = scroll_view_->GetContents()->GetPreferredSize(); | 264 gfx::Size prefsize = scroll_view_->GetContents()->GetPreferredSize(); |
264 gfx::Insets insets = GetInsets(); | 265 gfx::Insets insets = GetInsets(); |
265 prefsize.Enlarge(insets.width(), insets.height()); | 266 prefsize.Enlarge(insets.width(), insets.height()); |
266 return prefsize; | 267 return prefsize; |
267 } | 268 } |
268 | 269 |
269 bool MenuScrollViewContainer::GetAccessibleRole( | 270 bool MenuScrollViewContainer::GetAccessibleRole( |
270 AccessibilityTypes::Role* role) { | 271 AccessibilityTypes::Role* role) { |
271 DCHECK(role); | 272 DCHECK(role); |
272 *role = AccessibilityTypes::ROLE_MENUPOPUP; | 273 *role = AccessibilityTypes::ROLE_MENUPOPUP; |
273 return true; | 274 return true; |
274 } | 275 } |
275 | 276 |
276 } // namespace views | 277 } // namespace views |
OLD | NEW |