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

Unified Diff: chrome/browser/views/options/advanced_contents_view.cc

Issue 2812026: Auto-size the views version of the options dialog. (Closed)
Patch Set: Fix autosizing issue with gtk pref pages in chromeos options dialog. Created 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/views/options/advanced_contents_view.cc
diff --git a/chrome/browser/views/options/advanced_contents_view.cc b/chrome/browser/views/options/advanced_contents_view.cc
index 9ee6485e58eea3ac5d219d257b20fbc442ec61be..bbe232fce68505bf5fde5482ed7d0e344019928d 100644
--- a/chrome/browser/views/options/advanced_contents_view.cc
+++ b/chrome/browser/views/options/advanced_contents_view.cc
@@ -287,7 +287,6 @@ AdvancedSection::AdvancedSection(Profile* profile,
void AdvancedSection::DidChangeBounds(const gfx::Rect& previous,
const gfx::Rect& current) {
Layout();
- contents_->Layout();
}
////////////////////////////////////////////////////////////////////////////////
@@ -434,9 +433,6 @@ class PrivacySection : public AdvancedSection,
// Overridden from views::LinkController:
virtual void LinkActivated(views::Link* source, int event_flags);
- // Overridden from views::View:
- virtual void Layout();
-
protected:
// OptionsPageView overrides:
virtual void InitControlLayout();
@@ -549,22 +545,6 @@ void PrivacySection::LinkActivated(views::Link* source, int event_flags) {
}
}
-void PrivacySection::Layout() {
- if (reporting_enabled_checkbox_) {
- // We override this to try and set the width of the enable logging checkbox
- // to the width of the parent less some fudging since the checkbox's
- // preferred size calculation code is dependent on its width, and if we
- // don't do this then it will return 0 as a preferred width when GridLayout
- // (called from View::Layout) tries to access it.
- views::View* parent = GetParent();
- if (parent && parent->width()) {
- const int parent_width = parent->width();
- reporting_enabled_checkbox_->SetBounds(0, 0, parent_width - 20, 0);
- }
- }
- View::Layout();
-}
-
void PrivacySection::InitControlLayout() {
AdvancedSection::InitControlLayout();
@@ -636,8 +616,8 @@ void PrivacySection::InitControlLayout() {
reporting_enabled_checkbox_ != NULL);
// The "Help make Google Chrome better" checkbox.
if (reporting_enabled_checkbox_) {
- AddLeadingControl(layout, reporting_enabled_checkbox_, indented_view_set_id,
- false);
+ AddWrappingCheckboxRow(layout, reporting_enabled_checkbox_,
+ indented_view_set_id, false);
}
// Init member prefs so we can update the controls if prefs change.
@@ -1421,5 +1401,4 @@ void AdvancedScrollViewContainer::Layout() {
gfx::NativeTheme::LIST);
lb.Inset(border.width(), border.height());
scroll_view_->SetBounds(lb);
- scroll_view_->Layout();
}
« no previous file with comments | « chrome/browser/chromeos/options/options_window_view.cc ('k') | chrome/browser/views/options/content_page_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698