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

Side by Side Diff: ui/views/controls/tabbed_pane/tabbed_pane.cc

Issue 14367021: Rename ClampToMin and ClampToMax (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 6 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
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/tabbed_pane/tabbed_pane.h" 5 #include "ui/views/controls/tabbed_pane/tabbed_pane.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/base/accessibility/accessible_view_state.h" 8 #include "ui/base/accessibility/accessible_view_state.h"
9 #include "ui/base/keycodes/keyboard_codes.h" 9 #include "ui/base/keycodes/keyboard_codes.h"
10 #include "ui/gfx/canvas.h" 10 #include "ui/gfx/canvas.h"
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 301
302 void TabbedPane::SelectTab(Tab* tab) { 302 void TabbedPane::SelectTab(Tab* tab) {
303 const int index = tab_strip_->GetIndexOf(tab); 303 const int index = tab_strip_->GetIndexOf(tab);
304 if (index >= 0) 304 if (index >= 0)
305 SelectTabAt(index); 305 SelectTabAt(index);
306 } 306 }
307 307
308 gfx::Size TabbedPane::GetPreferredSize() { 308 gfx::Size TabbedPane::GetPreferredSize() {
309 gfx::Size size; 309 gfx::Size size;
310 for (int i = 0; i < contents_->child_count(); ++i) 310 for (int i = 0; i < contents_->child_count(); ++i)
311 size.ClampToMin(contents_->child_at(i)->GetPreferredSize()); 311 size.SetToMax(contents_->child_at(i)->GetPreferredSize());
312 size.Enlarge(0, tab_strip_->GetPreferredSize().height()); 312 size.Enlarge(0, tab_strip_->GetPreferredSize().height());
313 return size; 313 return size;
314 } 314 }
315 315
316 Tab* TabbedPane::GetTabAt(int index) { 316 Tab* TabbedPane::GetTabAt(int index) {
317 return static_cast<Tab*>(tab_strip_->child_at(index)); 317 return static_cast<Tab*>(tab_strip_->child_at(index));
318 } 318 }
319 319
320 void TabbedPane::Layout() { 320 void TabbedPane::Layout() {
321 const gfx::Size size = tab_strip_->GetPreferredSize(); 321 const gfx::Size size = tab_strip_->GetPreferredSize();
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 selected_tab->NotifyAccessibilityEvent( 363 selected_tab->NotifyAccessibilityEvent(
364 ui::AccessibilityTypes::EVENT_FOCUS, true); 364 ui::AccessibilityTypes::EVENT_FOCUS, true);
365 } 365 }
366 } 366 }
367 367
368 void TabbedPane::GetAccessibleState(ui::AccessibleViewState* state) { 368 void TabbedPane::GetAccessibleState(ui::AccessibleViewState* state) {
369 state->role = ui::AccessibilityTypes::ROLE_PAGETABLIST; 369 state->role = ui::AccessibilityTypes::ROLE_PAGETABLIST;
370 } 370 }
371 371
372 } // namespace views 372 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/scrollbar/kennedy_scroll_bar.cc ('k') | ui/views/examples/progress_bar_example.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698