| 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_bubble.h" | 5 #include "chrome/browser/ui/views/first_run_bubble.h" |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/first_run/first_run.h" | 8 #include "chrome/browser/first_run/first_run.h" |
| 9 #include "chrome/browser/search_engines/util.h" | 9 #include "chrome/browser/search_engines/util.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 FirstRunMinimalBubbleView::FirstRunMinimalBubbleView( | 414 FirstRunMinimalBubbleView::FirstRunMinimalBubbleView( |
| 415 FirstRunBubble* bubble_window, | 415 FirstRunBubble* bubble_window, |
| 416 Profile* profile) | 416 Profile* profile) |
| 417 : bubble_window_(bubble_window), | 417 : bubble_window_(bubble_window), |
| 418 profile_(profile), | 418 profile_(profile), |
| 419 label1_(NULL), | 419 label1_(NULL), |
| 420 label2_(NULL) { | 420 label2_(NULL) { |
| 421 const gfx::Font& font = | 421 const gfx::Font& font = |
| 422 ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::MediumFont); | 422 ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::MediumFont); |
| 423 | 423 |
| 424 label1_ = new views::Label(UTF16ToWide(l10n_util::GetStringFUTF16( | 424 label1_ = new views::Label(l10n_util::GetStringFUTF16( |
| 425 IDS_FR_SE_BUBBLE_TITLE, | 425 IDS_FR_SE_BUBBLE_TITLE, |
| 426 GetDefaultSearchEngineName(profile_)))); | 426 GetDefaultSearchEngineName(profile_))); |
| 427 label1_->SetFont(font.DeriveFont(3, gfx::Font::BOLD)); | 427 label1_->SetFont(font.DeriveFont(3, gfx::Font::BOLD)); |
| 428 label1_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); | 428 label1_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); |
| 429 AddChildView(label1_); | 429 AddChildView(label1_); |
| 430 | 430 |
| 431 gfx::Size ps = GetPreferredSize(); | 431 gfx::Size ps = GetPreferredSize(); |
| 432 | 432 |
| 433 label2_ = new views::Label( | 433 label2_ = new views::Label( |
| 434 UTF16ToWide(l10n_util::GetStringUTF16(IDS_FR_BUBBLE_SUBTEXT))); | 434 UTF16ToWide(l10n_util::GetStringUTF16(IDS_FR_BUBBLE_SUBTEXT))); |
| 435 label2_->SetMultiLine(true); | 435 label2_->SetMultiLine(true); |
| 436 label2_->SetFont(font); | 436 label2_->SetFont(font); |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 // Keep window from automatically closing until kLingerTime has passed. | 559 // Keep window from automatically closing until kLingerTime has passed. |
| 560 if (::IsWindowEnabled(GetParent())) | 560 if (::IsWindowEnabled(GetParent())) |
| 561 Bubble::OnActivate(action, minimized, window); | 561 Bubble::OnActivate(action, minimized, window); |
| 562 } | 562 } |
| 563 | 563 |
| 564 void FirstRunBubble::BubbleClosing(Bubble* bubble, bool closed_by_escape) { | 564 void FirstRunBubble::BubbleClosing(Bubble* bubble, bool closed_by_escape) { |
| 565 // Make sure our parent window is re-enabled. | 565 // Make sure our parent window is re-enabled. |
| 566 if (!IsWindowEnabled(GetParent())) | 566 if (!IsWindowEnabled(GetParent())) |
| 567 ::EnableWindow(GetParent(), true); | 567 ::EnableWindow(GetParent(), true); |
| 568 } | 568 } |
| OLD | NEW |