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

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

Issue 7057014: Variety of tweaks to View API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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 | « views/controls/single_split_view.cc ('k') | views/controls/tabbed_pane/tabbed_pane.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) 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
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
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
OLDNEW
« no previous file with comments | « views/controls/single_split_view.cc ('k') | views/controls/tabbed_pane/tabbed_pane.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698