| 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/scoped_ptr.h" | 6 #include "base/scoped_ptr.h" |
| 7 #include "chrome/browser/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
| 8 #include "chrome/browser/chromeos/options/internet_page_view.h" | 8 #include "chrome/browser/chromeos/options/internet_page_view.h" |
| 9 #include "chrome/browser/chromeos/options/system_page_view.h" | 9 #include "chrome/browser/chromeos/options/system_page_view.h" |
| 10 #include "chrome/browser/gtk/options/advanced_page_gtk.h" | 10 #include "chrome/browser/gtk/options/advanced_page_gtk.h" |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 | 206 |
| 207 tabs_->SelectTabAt(static_cast<int>(page)); | 207 tabs_->SelectTabAt(static_cast<int>(page)); |
| 208 | 208 |
| 209 // TODO(xiyuan): set highlight_group | 209 // TODO(xiyuan): set highlight_group |
| 210 } | 210 } |
| 211 | 211 |
| 212 /////////////////////////////////////////////////////////////////////////////// | 212 /////////////////////////////////////////////////////////////////////////////// |
| 213 // OptionsWindowView, views::DialogDelegate implementation: | 213 // OptionsWindowView, views::DialogDelegate implementation: |
| 214 | 214 |
| 215 std::wstring OptionsWindowView::GetWindowTitle() const { | 215 std::wstring OptionsWindowView::GetWindowTitle() const { |
| 216 return l10n_util::GetStringF(IDS_OPTIONS_DIALOG_TITLE, | 216 return UTF16ToWide( |
| 217 l10n_util::GetString(IDS_PRODUCT_NAME)); | 217 l10n_util::GetStringFUTF16(IDS_OPTIONS_DIALOG_TITLE, |
| 218 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); |
| 218 } | 219 } |
| 219 | 220 |
| 220 void OptionsWindowView::WindowClosing() { | 221 void OptionsWindowView::WindowClosing() { |
| 221 // Clear the static instance so that the next time ShowOptionsWindow() is | 222 // Clear the static instance so that the next time ShowOptionsWindow() is |
| 222 // called a new window is opened. | 223 // called a new window is opened. |
| 223 instance_ = NULL; | 224 instance_ = NULL; |
| 224 } | 225 } |
| 225 | 226 |
| 226 bool OptionsWindowView::Cancel() { | 227 bool OptionsWindowView::Cancel() { |
| 227 OptionsPageView* selected_option_page = GetCurrentOptionsPageView(); | 228 OptionsPageView* selected_option_page = GetCurrentOptionsPageView(); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 // to apply specific drawings for this widget. | 294 // to apply specific drawings for this widget. |
| 294 gtk_widget_set_name(GTK_WIDGET(notebook), "chromeos-options-tab"); | 295 gtk_widget_set_name(GTK_WIDGET(notebook), "chromeos-options-tab"); |
| 295 | 296 |
| 296 // Setup tab pages. | 297 // Setup tab pages. |
| 297 int tab_index = 0; | 298 int tab_index = 0; |
| 298 | 299 |
| 299 SystemPageView* system_page = new SystemPageView(profile_); | 300 SystemPageView* system_page = new SystemPageView(profile_); |
| 300 system_page->set_background(views::Background::CreateSolidBackground( | 301 system_page->set_background(views::Background::CreateSolidBackground( |
| 301 SK_ColorWHITE)); | 302 SK_ColorWHITE)); |
| 302 tabs_->AddTabAtIndex(tab_index++, | 303 tabs_->AddTabAtIndex(tab_index++, |
| 303 l10n_util::GetString(IDS_OPTIONS_SYSTEM_TAB_LABEL), | 304 UTF16ToWide(l10n_util::GetStringUTF16( |
| 305 IDS_OPTIONS_SYSTEM_TAB_LABEL)), |
| 304 system_page, false); | 306 system_page, false); |
| 305 | 307 |
| 306 InternetPageView* internet_page = new InternetPageView(profile_); | 308 InternetPageView* internet_page = new InternetPageView(profile_); |
| 307 internet_page->set_background(views::Background::CreateSolidBackground( | 309 internet_page->set_background(views::Background::CreateSolidBackground( |
| 308 SK_ColorWHITE)); | 310 SK_ColorWHITE)); |
| 309 tabs_->AddTabAtIndex(tab_index++, | 311 tabs_->AddTabAtIndex(tab_index++, |
| 310 l10n_util::GetString(IDS_OPTIONS_INTERNET_TAB_LABEL), | 312 UTF16ToWide(l10n_util::GetStringUTF16( |
| 313 IDS_OPTIONS_INTERNET_TAB_LABEL)), |
| 311 internet_page, false); | 314 internet_page, false); |
| 312 | 315 |
| 313 tabs_->AddTabAtIndex(tab_index++, | 316 tabs_->AddTabAtIndex(tab_index++, |
| 314 l10n_util::GetString(IDS_OPTIONS_GENERAL_TAB_LABEL), | 317 UTF16ToWide(l10n_util::GetStringUTF16( |
| 318 IDS_OPTIONS_GENERAL_TAB_LABEL)), |
| 315 new GtkPreferencePageHost( | 319 new GtkPreferencePageHost( |
| 316 general_page_.get_page_widget()), | 320 general_page_.get_page_widget()), |
| 317 false); | 321 false); |
| 318 | 322 |
| 319 tabs_->AddTabAtIndex(tab_index++, | 323 tabs_->AddTabAtIndex(tab_index++, |
| 320 l10n_util::GetString(IDS_OPTIONS_CONTENT_TAB_LABEL), | 324 UTF16ToWide(l10n_util::GetStringUTF16( |
| 325 IDS_OPTIONS_CONTENT_TAB_LABEL)), |
| 321 new GtkPreferencePageHost( | 326 new GtkPreferencePageHost( |
| 322 content_page_.get_page_widget()), | 327 content_page_.get_page_widget()), |
| 323 false); | 328 false); |
| 324 | 329 |
| 325 tabs_->AddTabAtIndex(tab_index++, | 330 tabs_->AddTabAtIndex(tab_index++, |
| 326 l10n_util::GetString(IDS_OPTIONS_ADVANCED_TAB_LABEL), | 331 UTF16ToWide(l10n_util::GetStringUTF16( |
| 332 IDS_OPTIONS_ADVANCED_TAB_LABEL)), |
| 327 new GtkPreferencePageHost( | 333 new GtkPreferencePageHost( |
| 328 advanced_page_.get_page_widget()), | 334 advanced_page_.get_page_widget()), |
| 329 false); | 335 false); |
| 330 | 336 |
| 331 DCHECK(tabs_->GetTabCount() == OPTIONS_PAGE_COUNT); | 337 DCHECK(tabs_->GetTabCount() == OPTIONS_PAGE_COUNT); |
| 332 | 338 |
| 333 initialized_ = true; | 339 initialized_ = true; |
| 334 } | 340 } |
| 335 | 341 |
| 336 OptionsPageView* OptionsWindowView::GetCurrentOptionsPageView() const { | 342 OptionsPageView* OptionsWindowView::GetCurrentOptionsPageView() const { |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 // a new one for the current active browser. | 384 // a new one for the current active browser. |
| 379 chromeos::CloseOptionsWindow(); | 385 chromeos::CloseOptionsWindow(); |
| 380 | 386 |
| 381 OptionsWindowView::instance_ = new OptionsWindowView(profile); | 387 OptionsWindowView::instance_ = new OptionsWindowView(profile); |
| 382 browser::CreateViewsWindow(chromeos::GetOptionsViewParent(), | 388 browser::CreateViewsWindow(chromeos::GetOptionsViewParent(), |
| 383 gfx::Rect(), | 389 gfx::Rect(), |
| 384 OptionsWindowView::instance_); | 390 OptionsWindowView::instance_); |
| 385 | 391 |
| 386 OptionsWindowView::instance_->ShowOptionsPage(page, highlight_group); | 392 OptionsWindowView::instance_->ShowOptionsPage(page, highlight_group); |
| 387 } | 393 } |
| OLD | NEW |