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

Side by Side Diff: chrome/browser/views/options/advanced_contents_view.cc

Issue 7344: Convert GetPreferredSize from:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years, 2 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "chrome/browser/views/options/advanced_contents_view.h" 5 #include "chrome/browser/views/options/advanced_contents_view.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include <cryptuiapi.h> 9 #include <cryptuiapi.h>
10 #pragma comment(lib, "cryptui.lib") 10 #pragma comment(lib, "cryptui.lib")
(...skipping 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after
1099 return View::GetPageScrollIncrement(scroll_view, is_horizontal, is_positive); 1099 return View::GetPageScrollIncrement(scroll_view, is_horizontal, is_positive);
1100 } 1100 }
1101 1101
1102 void AdvancedContentsView::Layout() { 1102 void AdvancedContentsView::Layout() {
1103 ChromeViews::View* parent = GetParent(); 1103 ChromeViews::View* parent = GetParent();
1104 if (parent && parent->width()) { 1104 if (parent && parent->width()) {
1105 const int width = parent->width(); 1105 const int width = parent->width();
1106 const int height = GetHeightForWidth(width); 1106 const int height = GetHeightForWidth(width);
1107 SetBounds(0, 0, width, height); 1107 SetBounds(0, 0, width, height);
1108 } else { 1108 } else {
1109 CSize pref; 1109 SetBounds(gfx::Point(), GetPreferredSize());
1110 GetPreferredSize(&pref);
1111 SetBounds(0, 0, pref.cx, pref.cy);
1112 } 1110 }
1113 View::Layout(); 1111 View::Layout();
1114 } 1112 }
1115 1113
1116 //////////////////////////////////////////////////////////////////////////////// 1114 ////////////////////////////////////////////////////////////////////////////////
1117 // AdvancedContentsView, OptionsPageView implementation: 1115 // AdvancedContentsView, OptionsPageView implementation:
1118 1116
1119 void AdvancedContentsView::InitControlLayout() { 1117 void AdvancedContentsView::InitControlLayout() {
1120 using ChromeViews::GridLayout; 1118 using ChromeViews::GridLayout;
1121 using ChromeViews::ColumnSet; 1119 using ChromeViews::ColumnSet;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
1171 CRect lb; 1169 CRect lb;
1172 GetLocalBounds(&lb, false); 1170 GetLocalBounds(&lb, false);
1173 1171
1174 gfx::Size border = gfx::NativeTheme::instance()->GetThemeBorderSize( 1172 gfx::Size border = gfx::NativeTheme::instance()->GetThemeBorderSize(
1175 gfx::NativeTheme::LIST); 1173 gfx::NativeTheme::LIST);
1176 lb.DeflateRect(border.ToSIZE()); 1174 lb.DeflateRect(border.ToSIZE());
1177 scroll_view_->SetBounds(lb); 1175 scroll_view_->SetBounds(lb);
1178 scroll_view_->Layout(); 1176 scroll_view_->Layout();
1179 } 1177 }
1180 1178
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698