| 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/chromeos/options/settings_page_view.h" | 5 #include "chrome/browser/chromeos/options/settings_page_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/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/utf_string_conversions.h" |
| 10 #include "gfx/skia_utils_gtk.h" | 11 #include "gfx/skia_utils_gtk.h" |
| 11 #include "views/controls/label.h" | 12 #include "views/controls/label.h" |
| 12 #include "views/fill_layout.h" | 13 #include "views/fill_layout.h" |
| 13 #include "views/widget/widget_gtk.h" | 14 #include "views/widget/widget_gtk.h" |
| 14 | 15 |
| 15 namespace chromeos { | 16 namespace chromeos { |
| 16 | 17 |
| 17 SettingsPageView::SettingsPageView(Profile* profile) | 18 SettingsPageView::SettingsPageView(Profile* profile) |
| 18 : OptionsPageView(profile) { | 19 : OptionsPageView(profile) { |
| 19 SetLayoutManager(new views::FillLayout()); | 20 SetLayoutManager(new views::FillLayout()); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 column_set->AddColumn(GridLayout::LEADING, GridLayout::LEADING, 0, | 60 column_set->AddColumn(GridLayout::LEADING, GridLayout::LEADING, 0, |
| 60 GridLayout::USE_PREF, 0, 0); | 61 GridLayout::USE_PREF, 0, 0); |
| 61 int inset_column_layout_id = 1; | 62 int inset_column_layout_id = 1; |
| 62 column_set = layout->AddColumnSet(inset_column_layout_id); | 63 column_set = layout->AddColumnSet(inset_column_layout_id); |
| 63 column_set->AddPaddingColumn(0, kUnrelatedControlHorizontalSpacing); | 64 column_set->AddPaddingColumn(0, kUnrelatedControlHorizontalSpacing); |
| 64 column_set->AddColumn(GridLayout::FILL, GridLayout::LEADING, 1, | 65 column_set->AddColumn(GridLayout::FILL, GridLayout::LEADING, 1, |
| 65 GridLayout::USE_PREF, 0, 0); | 66 GridLayout::USE_PREF, 0, 0); |
| 66 | 67 |
| 67 layout->StartRow(0, single_column_layout_id); | 68 layout->StartRow(0, single_column_layout_id); |
| 68 views::Label* title_label = new views::Label( | 69 views::Label* title_label = new views::Label( |
| 69 l10n_util::GetString(title_msg_id_)); | 70 UTF16ToWide(l10n_util::GetStringUTF16(title_msg_id_))); |
| 70 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 71 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 71 gfx::Font title_font = | 72 gfx::Font title_font = |
| 72 rb.GetFont(ResourceBundle::BaseFont).DeriveFont(0, gfx::Font::BOLD); | 73 rb.GetFont(ResourceBundle::BaseFont).DeriveFont(0, gfx::Font::BOLD); |
| 73 title_label->SetFont(title_font); | 74 title_label->SetFont(title_font); |
| 74 layout->AddView(title_label); | 75 layout->AddView(title_label); |
| 75 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); | 76 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); |
| 76 layout->StartRow(0, inset_column_layout_id); | 77 layout->StartRow(0, inset_column_layout_id); |
| 77 | 78 |
| 78 views::View* contents = new views::View; | 79 views::View* contents = new views::View; |
| 79 GridLayout* child_layout = new GridLayout(contents); | 80 GridLayout* child_layout = new GridLayout(contents); |
| 80 contents->SetLayoutManager(child_layout); | 81 contents->SetLayoutManager(child_layout); |
| 81 | 82 |
| 82 column_set = child_layout->AddColumnSet(single_column_view_set_id_); | 83 column_set = child_layout->AddColumnSet(single_column_view_set_id_); |
| 83 column_set->AddColumn(GridLayout::FILL, GridLayout::CENTER, 1, | 84 column_set->AddColumn(GridLayout::FILL, GridLayout::CENTER, 1, |
| 84 GridLayout::USE_PREF, 0, 0); | 85 GridLayout::USE_PREF, 0, 0); |
| 85 | 86 |
| 86 column_set = child_layout->AddColumnSet(double_column_view_set_id_); | 87 column_set = child_layout->AddColumnSet(double_column_view_set_id_); |
| 87 column_set->AddColumn(GridLayout::FILL, GridLayout::CENTER, 0, | 88 column_set->AddColumn(GridLayout::FILL, GridLayout::CENTER, 0, |
| 88 GridLayout::USE_PREF, 0, 0); | 89 GridLayout::USE_PREF, 0, 0); |
| 89 column_set->AddPaddingColumn(0, kRelatedControlHorizontalSpacing); | 90 column_set->AddPaddingColumn(0, kRelatedControlHorizontalSpacing); |
| 90 column_set->AddColumn(GridLayout::FILL, GridLayout::CENTER, 1, | 91 column_set->AddColumn(GridLayout::FILL, GridLayout::CENTER, 1, |
| 91 GridLayout::USE_PREF, 0, 0); | 92 GridLayout::USE_PREF, 0, 0); |
| 92 | 93 |
| 93 InitContents(child_layout); | 94 InitContents(child_layout); |
| 94 layout->AddView(contents); | 95 layout->AddView(contents); |
| 95 } | 96 } |
| 96 | 97 |
| 97 } // namespace chromeos | 98 } // namespace chromeos |
| OLD | NEW |