| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 width() - (2 * kDialogPadding), | 66 width() - (2 * kDialogPadding), |
| 67 height() - (2 * kDialogPadding)); | 67 height() - (2 * kDialogPadding)); |
| 68 } | 68 } |
| 69 | 69 |
| 70 gfx::Size FontsLanguagesWindowView::GetPreferredSize() { | 70 gfx::Size FontsLanguagesWindowView::GetPreferredSize() { |
| 71 return gfx::Size(views::Window::GetLocalizedContentsSize( | 71 return gfx::Size(views::Window::GetLocalizedContentsSize( |
| 72 IDS_FONTSLANG_DIALOG_WIDTH_CHARS, | 72 IDS_FONTSLANG_DIALOG_WIDTH_CHARS, |
| 73 IDS_FONTSLANG_DIALOG_HEIGHT_LINES)); | 73 IDS_FONTSLANG_DIALOG_HEIGHT_LINES)); |
| 74 } | 74 } |
| 75 | 75 |
| 76 void FontsLanguagesWindowView::SelectLanguagesTab() { |
| 77 tabs_->SelectTabForContents(languages_page_); |
| 78 } |
| 79 |
| 76 void FontsLanguagesWindowView::ViewHierarchyChanged( | 80 void FontsLanguagesWindowView::ViewHierarchyChanged( |
| 77 bool is_add, views::View* parent, views::View* child) { | 81 bool is_add, views::View* parent, views::View* child) { |
| 78 // Can't init before we're inserted into a Container, because we require | 82 // Can't init before we're inserted into a Container, because we require |
| 79 // a HWND to parent native child controls to. | 83 // a HWND to parent native child controls to. |
| 80 if (is_add && child == this) | 84 if (is_add && child == this) |
| 81 Init(); | 85 Init(); |
| 82 } | 86 } |
| 83 | 87 |
| 84 /////////////////////////////////////////////////////////////////////////////// | 88 /////////////////////////////////////////////////////////////////////////////// |
| 85 // FontsLanguagesWindowView, private: | 89 // FontsLanguagesWindowView, private: |
| 86 | 90 |
| 87 void FontsLanguagesWindowView::Init() { | 91 void FontsLanguagesWindowView::Init() { |
| 88 tabs_ = new views::TabbedPane; | 92 tabs_ = new views::TabbedPane; |
| 89 AddChildView(tabs_); | 93 AddChildView(tabs_); |
| 90 | 94 |
| 91 fonts_page_ = new FontsPageView(profile_); | 95 fonts_page_ = new FontsPageView(profile_); |
| 92 tabs_->AddTabAtIndex(0, l10n_util::GetString( | 96 tabs_->AddTab(l10n_util::GetString( |
| 93 IDS_FONT_LANGUAGE_SETTING_FONT_TAB_TITLE), fonts_page_, true); | 97 IDS_FONT_LANGUAGE_SETTING_FONT_TAB_TITLE), fonts_page_); |
| 94 | 98 |
| 95 languages_page_ = new LanguagesPageView(profile_); | 99 languages_page_ = new LanguagesPageView(profile_); |
| 96 tabs_->AddTabAtIndex(1, l10n_util::GetString( | 100 tabs_->AddTab(l10n_util::GetString( |
| 97 IDS_FONT_LANGUAGE_SETTING_LANGUAGES_TAB_TITLE), languages_page_, true); | 101 IDS_FONT_LANGUAGE_SETTING_LANGUAGES_TAB_TITLE), languages_page_); |
| 98 } | 102 } |
| 99 | 103 |
| OLD | NEW |