OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/content_settings_window_view.h" | 5 #include "chrome/browser/views/options/content_settings_window_view.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
9 #include "base/stl_util-inl.h" | 9 #include "base/stl_util-inl.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 views::Listbox* sender) { | 111 views::Listbox* sender) { |
112 DCHECK_EQ(listbox_, sender); | 112 DCHECK_EQ(listbox_, sender); |
113 ShowSettingsPage(listbox_->SelectedRow()); | 113 ShowSettingsPage(listbox_->SelectedRow()); |
114 last_selected_page_.SetValue(current_page_); | 114 last_selected_page_.SetValue(current_page_); |
115 } | 115 } |
116 | 116 |
117 /////////////////////////////////////////////////////////////////////////////// | 117 /////////////////////////////////////////////////////////////////////////////// |
118 // ContentSettingsWindowView, views::View overrides: | 118 // ContentSettingsWindowView, views::View overrides: |
119 | 119 |
120 void ContentSettingsWindowView::Layout() { | 120 void ContentSettingsWindowView::Layout() { |
121 int list_box_width = views::Window::GetLocalizedContentsWidth( | 121 int listbox_width = views::Window::GetLocalizedContentsWidth( |
122 IDS_CONTENT_SETTINGS_DIALOG_LISTBOX_WIDTH_CHARS); | 122 IDS_CONTENT_SETTINGS_DIALOG_LISTBOX_WIDTH_CHARS); |
123 label_->SetBounds(kDialogPadding, | 123 label_->SetBounds(kDialogPadding, |
124 kDialogPadding, | 124 kDialogPadding, |
125 list_box_width, | 125 listbox_width, |
126 label_->GetPreferredSize().height()); | 126 label_->GetPreferredSize().height()); |
127 | 127 |
128 listbox_->SetBounds(kDialogPadding, | 128 listbox_->SetBounds(kDialogPadding, |
129 2 * kDialogPadding + label_->height(), | 129 2 * kDialogPadding + label_->height(), |
130 list_box_width, | 130 listbox_width, |
131 height() - (3 * kDialogPadding) - label_->height()); | 131 height() - (3 * kDialogPadding) - label_->height()); |
132 | 132 |
133 if (pages_[current_page_]->GetParent()) { | 133 if (pages_[current_page_]->GetParent()) { |
134 pages_[current_page_]->SetBounds( | 134 pages_[current_page_]->SetBounds( |
135 2 * kDialogPadding + list_box_width, | 135 2 * kDialogPadding + listbox_width, |
136 2 * kDialogPadding + label_->height(), | 136 2 * kDialogPadding + label_->height(), |
137 width() - (3 * kDialogPadding) - list_box_width, | 137 width() - (3 * kDialogPadding) - listbox_width, |
138 height() - (2 * kDialogPadding)); | 138 height() - (2 * kDialogPadding)); |
139 } | 139 } |
140 } | 140 } |
141 | 141 |
142 gfx::Size ContentSettingsWindowView::GetPreferredSize() { | 142 gfx::Size ContentSettingsWindowView::GetPreferredSize() { |
143 return gfx::Size(views::Window::GetLocalizedContentsSize( | 143 return gfx::Size(views::Window::GetLocalizedContentsSize( |
144 IDS_CONTENT_SETTINGS_DIALOG_WIDTH_CHARS, | 144 IDS_CONTENT_SETTINGS_DIALOG_WIDTH_CHARS, |
145 IDS_CONTENT_SETTINGS_DIALOG_HEIGHT_LINES)); | 145 IDS_CONTENT_SETTINGS_DIALOG_HEIGHT_LINES)); |
146 } | 146 } |
147 | 147 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 current_page_ = page; | 202 current_page_ = page; |
203 AddChildView(pages_[current_page_]); | 203 AddChildView(pages_[current_page_]); |
204 Layout(); | 204 Layout(); |
205 SchedulePaint(); | 205 SchedulePaint(); |
206 } | 206 } |
207 | 207 |
208 const OptionsPageView* | 208 const OptionsPageView* |
209 ContentSettingsWindowView::GetCurrentContentSettingsTabView() const { | 209 ContentSettingsWindowView::GetCurrentContentSettingsTabView() const { |
210 return static_cast<OptionsPageView*>(pages_[current_page_]); | 210 return static_cast<OptionsPageView*>(pages_[current_page_]); |
211 } | 211 } |
OLD | NEW |