| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/views/first_run_search_engine_view.h" | 5 #include "chrome/browser/ui/views/first_run_search_engine_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 background_image_->SetHorizontalAlignment(ImageView::LEADING); | 318 background_image_->SetHorizontalAlignment(ImageView::LEADING); |
| 319 } else { | 319 } else { |
| 320 background_image_->SetHorizontalAlignment(ImageView::TRAILING); | 320 background_image_->SetHorizontalAlignment(ImageView::TRAILING); |
| 321 } | 321 } |
| 322 | 322 |
| 323 AddChildView(background_image_); | 323 AddChildView(background_image_); |
| 324 | 324 |
| 325 int label_width = GetPreferredSize().width() - 2 * views::kPanelHorizMargin; | 325 int label_width = GetPreferredSize().width() - 2 * views::kPanelHorizMargin; |
| 326 | 326 |
| 327 // Add title and text asking the user to choose a search engine: | 327 // Add title and text asking the user to choose a search engine: |
| 328 title_label_ = new Label(l10n_util::GetStringUTF16( | 328 title_label_ = new Label(UTF16ToWide(l10n_util::GetStringUTF16( |
| 329 IDS_FR_SEARCH_MAIN_LABEL)); | 329 IDS_FR_SEARCH_MAIN_LABEL))); |
| 330 title_label_->SetColor(SK_ColorBLACK); | 330 title_label_->SetColor(SK_ColorBLACK); |
| 331 title_label_->SetFont(title_label_->font().DeriveFont(3, gfx::Font::BOLD)); | 331 title_label_->SetFont(title_label_->font().DeriveFont(3, gfx::Font::BOLD)); |
| 332 title_label_->SetMultiLine(true); | 332 title_label_->SetMultiLine(true); |
| 333 title_label_->SetHorizontalAlignment(Label::ALIGN_LEFT); | 333 title_label_->SetHorizontalAlignment(Label::ALIGN_LEFT); |
| 334 title_label_->SizeToFit(label_width); | 334 title_label_->SizeToFit(label_width); |
| 335 AddChildView(title_label_); | 335 AddChildView(title_label_); |
| 336 | 336 |
| 337 text_label_ = new Label(l10n_util::GetStringFUTF16( | 337 text_label_ = new Label(UTF16ToWide(l10n_util::GetStringFUTF16( |
| 338 IDS_FR_SEARCH_TEXT, | 338 IDS_FR_SEARCH_TEXT, |
| 339 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); | 339 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)))); |
| 340 text_label_->SetColor(SK_ColorBLACK); | 340 text_label_->SetColor(SK_ColorBLACK); |
| 341 text_label_->SetFont(text_label_->font().DeriveFont(1, gfx::Font::NORMAL)); | 341 text_label_->SetFont(text_label_->font().DeriveFont(1, gfx::Font::NORMAL)); |
| 342 text_label_->SetMultiLine(true); | 342 text_label_->SetMultiLine(true); |
| 343 text_label_->SetHorizontalAlignment(Label::ALIGN_LEFT); | 343 text_label_->SetHorizontalAlignment(Label::ALIGN_LEFT); |
| 344 text_label_->SizeToFit(label_width); | 344 text_label_->SizeToFit(label_width); |
| 345 AddChildView(text_label_); | 345 AddChildView(text_label_); |
| 346 } | 346 } |
| 347 | 347 |
| 348 void FirstRunSearchEngineView::Layout() { | 348 void FirstRunSearchEngineView::Layout() { |
| 349 // Disable the close button. | 349 // Disable the close button. |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 search_engine_choices_[3]->SetBounds(next_h_space, next_v_space, | 454 search_engine_choices_[3]->SetBounds(next_h_space, next_v_space, |
| 455 button_width, button_height); | 455 button_width, button_height); |
| 456 } | 456 } |
| 457 } // if (search_engine_choices.size() > 0) | 457 } // if (search_engine_choices.size() > 0) |
| 458 } | 458 } |
| 459 | 459 |
| 460 void FirstRunSearchEngineView::GetAccessibleState( | 460 void FirstRunSearchEngineView::GetAccessibleState( |
| 461 ui::AccessibleViewState* state) { | 461 ui::AccessibleViewState* state) { |
| 462 state->role = ui::AccessibilityTypes::ROLE_ALERT; | 462 state->role = ui::AccessibilityTypes::ROLE_ALERT; |
| 463 } | 463 } |
| OLD | NEW |