OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/tabbed_pane/native_tabbed_pane_win.h" | 5 #include "views/controls/tabbed_pane/native_tabbed_pane_win.h" |
6 | 6 |
7 #include <vssym32.h> | 7 #include <vssym32.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/stl_util-inl.h" | 10 #include "base/stl_util-inl.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 focus_manager->SetFocusedView(page); | 72 focus_manager->SetFocusedView(page); |
73 } | 73 } |
74 | 74 |
75 private: | 75 private: |
76 // LayoutManager overrides: | 76 // LayoutManager overrides: |
77 virtual void Layout(View* host) { | 77 virtual void Layout(View* host) { |
78 gfx::Rect bounds(host->GetContentsBounds()); | 78 gfx::Rect bounds(host->GetContentsBounds()); |
79 for (int i = 0; i < host->child_count(); ++i) { | 79 for (int i = 0; i < host->child_count(); ++i) { |
80 View* child = host->GetChildViewAt(i); | 80 View* child = host->GetChildViewAt(i); |
81 // We only layout visible children, since it may be expensive. | 81 // We only layout visible children, since it may be expensive. |
82 if (child->IsVisible() && child->bounds() != bounds) | 82 if (child->visible() && child->bounds() != bounds) |
83 child->SetBoundsRect(bounds); | 83 child->SetBoundsRect(bounds); |
84 } | 84 } |
85 } | 85 } |
86 | 86 |
87 virtual gfx::Size GetPreferredSize(View* host) { | 87 virtual gfx::Size GetPreferredSize(View* host) { |
88 // First, query the preferred sizes to determine a good width. | 88 // First, query the preferred sizes to determine a good width. |
89 int width = 0; | 89 int width = 0; |
90 for (int i = 0; i < host->child_count(); ++i) { | 90 for (int i = 0; i < host->child_count(); ++i) { |
91 View* page = host->GetChildViewAt(i); | 91 View* page = host->GetChildViewAt(i); |
92 width = std::max(width, page->GetPreferredSize().width()); | 92 width = std::max(width, page->GetPreferredSize().width()); |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 //////////////////////////////////////////////////////////////////////////////// | 398 //////////////////////////////////////////////////////////////////////////////// |
399 // NativeTabbedPaneWrapper, public: | 399 // NativeTabbedPaneWrapper, public: |
400 | 400 |
401 // static | 401 // static |
402 NativeTabbedPaneWrapper* NativeTabbedPaneWrapper::CreateNativeWrapper( | 402 NativeTabbedPaneWrapper* NativeTabbedPaneWrapper::CreateNativeWrapper( |
403 TabbedPane* tabbed_pane) { | 403 TabbedPane* tabbed_pane) { |
404 return new NativeTabbedPaneWin(tabbed_pane); | 404 return new NativeTabbedPaneWin(tabbed_pane); |
405 } | 405 } |
406 | 406 |
407 } // namespace views | 407 } // namespace views |
OLD | NEW |