| 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 "app/l10n_util.h" | 5 #include "app/l10n_util.h" |
| 6 #include "base/utf_string_conversions.h" | 6 #include "base/utf_string_conversions.h" |
| 7 #include "chrome/browser/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
| 8 #include "chrome/browser/prefs/pref_service.h" | 8 #include "chrome/browser/prefs/pref_service.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/browser_list.h" | 10 #include "chrome/browser/ui/browser_list.h" |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 // HWND to parent native child controls to. | 190 // HWND to parent native child controls to. |
| 191 if (is_add && child == this) | 191 if (is_add && child == this) |
| 192 Init(); | 192 Init(); |
| 193 } | 193 } |
| 194 | 194 |
| 195 /////////////////////////////////////////////////////////////////////////////// | 195 /////////////////////////////////////////////////////////////////////////////// |
| 196 // OptionsWindowView, private: | 196 // OptionsWindowView, private: |
| 197 | 197 |
| 198 void OptionsWindowView::Init() { | 198 void OptionsWindowView::Init() { |
| 199 tabs_ = new views::TabbedPane; | 199 tabs_ = new views::TabbedPane; |
| 200 tabs_->SetAccessibleName(UTF16ToWide( | 200 tabs_->SetAccessibleName(l10n_util::GetStringFUTF16( |
| 201 l10n_util::GetStringFUTF16(IDS_OPTIONS_DIALOG_TITLE, | 201 IDS_OPTIONS_DIALOG_TITLE, |
| 202 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)))); | 202 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); |
| 203 tabs_->SetListener(this); | 203 tabs_->SetListener(this); |
| 204 AddChildView(tabs_); | 204 AddChildView(tabs_); |
| 205 | 205 |
| 206 int tab_index = 0; | 206 int tab_index = 0; |
| 207 GeneralPageView* general_page = new GeneralPageView(profile_); | 207 GeneralPageView* general_page = new GeneralPageView(profile_); |
| 208 tabs_->AddTabAtIndex( | 208 tabs_->AddTabAtIndex( |
| 209 tab_index++, | 209 tab_index++, |
| 210 UTF16ToWide(l10n_util::GetStringUTF16(IDS_OPTIONS_GENERAL_TAB_LABEL)), | 210 UTF16ToWide(l10n_util::GetStringUTF16(IDS_OPTIONS_GENERAL_TAB_LABEL)), |
| 211 general_page, false); | 211 general_page, false); |
| 212 | 212 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 239 // If there's already an existing options window, activate it and switch to | 239 // If there's already an existing options window, activate it and switch to |
| 240 // the specified page. | 240 // the specified page. |
| 241 // TODO(beng): note this is not multi-simultaneous-profile-safe. When we care | 241 // TODO(beng): note this is not multi-simultaneous-profile-safe. When we care |
| 242 // about this case this will have to be fixed. | 242 // about this case this will have to be fixed. |
| 243 if (!instance_) { | 243 if (!instance_) { |
| 244 instance_ = new OptionsWindowView(profile); | 244 instance_ = new OptionsWindowView(profile); |
| 245 views::Window::CreateChromeWindow(NULL, gfx::Rect(), instance_); | 245 views::Window::CreateChromeWindow(NULL, gfx::Rect(), instance_); |
| 246 } | 246 } |
| 247 instance_->ShowOptionsPage(page, highlight_group); | 247 instance_->ShowOptionsPage(page, highlight_group); |
| 248 } | 248 } |
| OLD | NEW |