OLD | NEW |
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/fonts_languages_window_view.h" | 5 #include "chrome/browser/views/options/fonts_languages_window_view.h" |
6 | 6 |
7 #include "chrome/app/locales/locale_settings.h" | 7 #include "chrome/app/locales/locale_settings.h" |
8 #include "chrome/browser/profile.h" | 8 #include "chrome/browser/profile.h" |
9 #include "chrome/browser/views/options/fonts_page_view.h" | 9 #include "chrome/browser/views/options/fonts_page_view.h" |
10 #include "chrome/browser/views/options/languages_page_view.h" | 10 #include "chrome/browser/views/options/languages_page_view.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 60 |
61 /////////////////////////////////////////////////////////////////////////////// | 61 /////////////////////////////////////////////////////////////////////////////// |
62 // FontsLanguagesWindowView, ChromeViews::View overrides: | 62 // FontsLanguagesWindowView, ChromeViews::View overrides: |
63 | 63 |
64 void FontsLanguagesWindowView::Layout() { | 64 void FontsLanguagesWindowView::Layout() { |
65 tabs_->SetBounds(kDialogPadding, kDialogPadding, | 65 tabs_->SetBounds(kDialogPadding, kDialogPadding, |
66 width() - (2 * kDialogPadding), | 66 width() - (2 * kDialogPadding), |
67 height() - (2 * kDialogPadding)); | 67 height() - (2 * kDialogPadding)); |
68 } | 68 } |
69 | 69 |
70 void FontsLanguagesWindowView::GetPreferredSize(CSize* out) { | 70 gfx::Size FontsLanguagesWindowView::GetPreferredSize() { |
71 DCHECK(out); | 71 return gfx::Size(ChromeViews::Window::GetLocalizedContentsSize( |
72 *out = ChromeViews::Window::GetLocalizedContentsSize( | |
73 IDS_FONTSLANG_DIALOG_WIDTH_CHARS, | 72 IDS_FONTSLANG_DIALOG_WIDTH_CHARS, |
74 IDS_FONTSLANG_DIALOG_HEIGHT_LINES).ToSIZE(); | 73 IDS_FONTSLANG_DIALOG_HEIGHT_LINES)); |
75 } | 74 } |
76 | 75 |
77 void FontsLanguagesWindowView::ViewHierarchyChanged( | 76 void FontsLanguagesWindowView::ViewHierarchyChanged( |
78 bool is_add, ChromeViews::View* parent, ChromeViews::View* child) { | 77 bool is_add, ChromeViews::View* parent, ChromeViews::View* child) { |
79 // Can't init before we're inserted into a ViewContainer, because we require | 78 // Can't init before we're inserted into a ViewContainer, because we require |
80 // a HWND to parent native child controls to. | 79 // a HWND to parent native child controls to. |
81 if (is_add && child == this) | 80 if (is_add && child == this) |
82 Init(); | 81 Init(); |
83 } | 82 } |
84 | 83 |
85 /////////////////////////////////////////////////////////////////////////////// | 84 /////////////////////////////////////////////////////////////////////////////// |
86 // FontsLanguagesWindowView, private: | 85 // FontsLanguagesWindowView, private: |
87 | 86 |
88 void FontsLanguagesWindowView::Init() { | 87 void FontsLanguagesWindowView::Init() { |
89 tabs_ = new ChromeViews::TabbedPane; | 88 tabs_ = new ChromeViews::TabbedPane; |
90 AddChildView(tabs_); | 89 AddChildView(tabs_); |
91 | 90 |
92 fonts_page_ = new FontsPageView(profile_); | 91 fonts_page_ = new FontsPageView(profile_); |
93 tabs_->AddTabAtIndex(0, l10n_util::GetString( | 92 tabs_->AddTabAtIndex(0, l10n_util::GetString( |
94 IDS_FONT_LANGUAGE_SETTING_FONT_TAB_TITLE), fonts_page_, true); | 93 IDS_FONT_LANGUAGE_SETTING_FONT_TAB_TITLE), fonts_page_, true); |
95 | 94 |
96 languages_page_ = new LanguagesPageView(profile_); | 95 languages_page_ = new LanguagesPageView(profile_); |
97 tabs_->AddTabAtIndex(1, l10n_util::GetString( | 96 tabs_->AddTabAtIndex(1, l10n_util::GetString( |
98 IDS_FONT_LANGUAGE_SETTING_LANGUAGES_TAB_TITLE), languages_page_, true); | 97 IDS_FONT_LANGUAGE_SETTING_LANGUAGES_TAB_TITLE), languages_page_, true); |
99 } | 98 } |
100 | 99 |
OLD | NEW |