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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 text_label_->SetColor(SK_ColorBLACK); | 342 text_label_->SetColor(SK_ColorBLACK); |
343 text_label_->SetFont(text_label_->font().DeriveFont(1, gfx::Font::NORMAL)); | 343 text_label_->SetFont(text_label_->font().DeriveFont(1, gfx::Font::NORMAL)); |
344 text_label_->SetMultiLine(true); | 344 text_label_->SetMultiLine(true); |
345 text_label_->SetHorizontalAlignment(Label::ALIGN_LEFT); | 345 text_label_->SetHorizontalAlignment(Label::ALIGN_LEFT); |
346 text_label_->SizeToFit(label_width); | 346 text_label_->SizeToFit(label_width); |
347 AddChildView(text_label_); | 347 AddChildView(text_label_); |
348 } | 348 } |
349 | 349 |
350 void FirstRunSearchEngineView::Layout() { | 350 void FirstRunSearchEngineView::Layout() { |
351 // Disable the close button. | 351 // Disable the close button. |
352 GetWindow()->EnableClose(false); | 352 GetWidget()->EnableClose(false); |
353 | 353 |
354 gfx::Size pref_size = background_image_->GetPreferredSize(); | 354 gfx::Size pref_size = background_image_->GetPreferredSize(); |
355 background_image_->SetBounds(0, 0, GetPreferredSize().width(), | 355 background_image_->SetBounds(0, 0, GetPreferredSize().width(), |
356 pref_size.height()); | 356 pref_size.height()); |
357 | 357 |
358 // General vertical spacing between elements: | 358 // General vertical spacing between elements: |
359 const int kVertSpacing = 8; | 359 const int kVertSpacing = 8; |
360 // Percentage of vertical space around logos to use for upper padding. | 360 // Percentage of vertical space around logos to use for upper padding. |
361 const double kUpperPaddingPercent = 0.4; | 361 const double kUpperPaddingPercent = 0.4; |
362 | 362 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 } | 460 } |
461 | 461 |
462 void FirstRunSearchEngineView::GetAccessibleState( | 462 void FirstRunSearchEngineView::GetAccessibleState( |
463 ui::AccessibleViewState* state) { | 463 ui::AccessibleViewState* state) { |
464 state->role = ui::AccessibilityTypes::ROLE_ALERT; | 464 state->role = ui::AccessibilityTypes::ROLE_ALERT; |
465 } | 465 } |
466 | 466 |
467 std::wstring FirstRunSearchEngineView::GetWindowTitle() const { | 467 std::wstring FirstRunSearchEngineView::GetWindowTitle() const { |
468 return UTF16ToWide(l10n_util::GetStringUTF16(IDS_FIRSTRUN_DLG_TITLE)); | 468 return UTF16ToWide(l10n_util::GetStringUTF16(IDS_FIRSTRUN_DLG_TITLE)); |
469 } | 469 } |
OLD | NEW |