Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: ui/views/controls/menu/menu_scroll_view_container.cc

Issue 196133012: Fix incorrect use of AXState caused when refactoring two enums into one. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename SetStateFlag -> AddStateFlag Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/views/controls/menu/menu_item_view.cc ('k') | ui/views/controls/progress_bar.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 252
253 void MenuScrollViewContainer::GetAccessibleState( 253 void MenuScrollViewContainer::GetAccessibleState(
254 ui::AXViewState* state) { 254 ui::AXViewState* state) {
255 // Get the name from the submenu view. 255 // Get the name from the submenu view.
256 content_view_->GetAccessibleState(state); 256 content_view_->GetAccessibleState(state);
257 257
258 // Now change the role. 258 // Now change the role.
259 state->role = ui::AX_ROLE_MENU_BAR; 259 state->role = ui::AX_ROLE_MENU_BAR;
260 // Some AT (like NVDA) will not process focus events on menu item children 260 // Some AT (like NVDA) will not process focus events on menu item children
261 // unless a parent claims to be focused. 261 // unless a parent claims to be focused.
262 state->state = ui::AX_STATE_FOCUSED; 262 state->AddStateFlag(ui::AX_STATE_FOCUSED);
263 } 263 }
264 264
265 void MenuScrollViewContainer::OnBoundsChanged( 265 void MenuScrollViewContainer::OnBoundsChanged(
266 const gfx::Rect& previous_bounds) { 266 const gfx::Rect& previous_bounds) {
267 gfx::Size content_pref = scroll_view_->GetContents()->GetPreferredSize(); 267 gfx::Size content_pref = scroll_view_->GetContents()->GetPreferredSize();
268 scroll_up_button_->SetVisible(content_pref.height() > height()); 268 scroll_up_button_->SetVisible(content_pref.height() > height());
269 scroll_down_button_->SetVisible(content_pref.height() > height()); 269 scroll_down_button_->SetVisible(content_pref.height() > height());
270 Layout(); 270 Layout();
271 } 271 }
272 272
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 case views::MenuItemView::BUBBLE_ABOVE: 324 case views::MenuItemView::BUBBLE_ABOVE:
325 return BubbleBorder::BOTTOM_CENTER; 325 return BubbleBorder::BOTTOM_CENTER;
326 case views::MenuItemView::BUBBLE_BELOW: 326 case views::MenuItemView::BUBBLE_BELOW:
327 return BubbleBorder::TOP_CENTER; 327 return BubbleBorder::TOP_CENTER;
328 default: 328 default:
329 return BubbleBorder::NONE; 329 return BubbleBorder::NONE;
330 } 330 }
331 } 331 }
332 332
333 } // namespace views 333 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/menu/menu_item_view.cc ('k') | ui/views/controls/progress_bar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698