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

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

Issue 15071002: WIP - loop in LayoutManager for preferred size changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: scoped layouter Created 7 years, 7 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/button/label_button.cc ('k') | ui/views/layout/box_layout.h » ('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/submenu_view.h" 5 #include "ui/views/controls/menu/submenu_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "ui/base/accessibility/accessible_view_state.h" 10 #include "ui/base/accessibility/accessible_view_state.h"
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 const gfx::Rect& bounds, 301 const gfx::Rect& bounds,
302 bool do_capture) { 302 bool do_capture) {
303 if (host_) { 303 if (host_) {
304 host_->ShowMenuHost(do_capture); 304 host_->ShowMenuHost(do_capture);
305 } else { 305 } else {
306 host_ = new MenuHost(this); 306 host_ = new MenuHost(this);
307 // Force construction of the scroll view container. 307 // Force construction of the scroll view container.
308 GetScrollViewContainer(); 308 GetScrollViewContainer();
309 // Force a layout since our preferred size may not have changed but our 309 // Force a layout since our preferred size may not have changed but our
310 // content may have. 310 // content may have.
311 InvalidateLayout(); 311 Layout();
312 host_->InitMenuHost(parent, bounds, scroll_view_container_, do_capture); 312 host_->InitMenuHost(parent, bounds, scroll_view_container_, do_capture);
313 } 313 }
314 314
315 GetScrollViewContainer()->NotifyAccessibilityEvent( 315 GetScrollViewContainer()->NotifyAccessibilityEvent(
316 ui::AccessibilityTypes::EVENT_MENUSTART, 316 ui::AccessibilityTypes::EVENT_MENUSTART,
317 true); 317 true);
318 NotifyAccessibilityEvent( 318 NotifyAccessibilityEvent(
319 ui::AccessibilityTypes::EVENT_MENUPOPUPSTART, 319 ui::AccessibilityTypes::EVENT_MENUPOPUPSTART,
320 true); 320 true);
321 } 321 }
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 y = std::max(y, 0); 452 y = std::max(y, 0);
453 gfx::Rect new_vis_bounds(x, y, vis_bounds.width(), vis_bounds.height()); 453 gfx::Rect new_vis_bounds(x, y, vis_bounds.width(), vis_bounds.height());
454 if (new_vis_bounds != vis_bounds) { 454 if (new_vis_bounds != vis_bounds) {
455 ScrollRectToVisible(new_vis_bounds); 455 ScrollRectToVisible(new_vis_bounds);
456 return true; 456 return true;
457 } 457 }
458 return false; 458 return false;
459 } 459 }
460 460
461 } // namespace views 461 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/button/label_button.cc ('k') | ui/views/layout/box_layout.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698