OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/views/first_run_bubble.h" | 5 #include "chrome/browser/views/first_run_bubble.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
9 #include "base/win_util.h" | 9 #include "base/win_util.h" |
10 #include "chrome/browser/browser.h" | 10 #include "chrome/browser/browser.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 }; | 102 }; |
103 | 103 |
104 FirstRunBubbleView::FirstRunBubbleView(FirstRunBubble* bubble_window, | 104 FirstRunBubbleView::FirstRunBubbleView(FirstRunBubble* bubble_window, |
105 Profile* profile) | 105 Profile* profile) |
106 : bubble_window_(bubble_window), | 106 : bubble_window_(bubble_window), |
107 label1_(NULL), | 107 label1_(NULL), |
108 label2_(NULL), | 108 label2_(NULL), |
109 label3_(NULL), | 109 label3_(NULL), |
110 keep_button_(NULL), | 110 keep_button_(NULL), |
111 change_button_(NULL) { | 111 change_button_(NULL) { |
112 gfx::Font& font = | 112 const gfx::Font& font = |
113 ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::MediumFont); | 113 ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::MediumFont); |
114 | 114 |
115 label1_ = new views::Label(l10n_util::GetString(IDS_FR_BUBBLE_TITLE)); | 115 label1_ = new views::Label(l10n_util::GetString(IDS_FR_BUBBLE_TITLE)); |
116 label1_->SetFont(font.DeriveFont(3, gfx::Font::BOLD)); | 116 label1_->SetFont(font.DeriveFont(3, gfx::Font::BOLD)); |
117 label1_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); | 117 label1_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); |
118 AddChildView(label1_); | 118 AddChildView(label1_); |
119 | 119 |
120 gfx::Size ps = GetPreferredSize(); | 120 gfx::Size ps = GetPreferredSize(); |
121 | 121 |
122 label2_ = new views::Label(l10n_util::GetString(IDS_FR_BUBBLE_SUBTEXT)); | 122 label2_ = new views::Label(l10n_util::GetString(IDS_FR_BUBBLE_SUBTEXT)); |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 }; | 254 }; |
255 | 255 |
256 FirstRunOEMBubbleView::FirstRunOEMBubbleView(FirstRunBubble* bubble_window, | 256 FirstRunOEMBubbleView::FirstRunOEMBubbleView(FirstRunBubble* bubble_window, |
257 Profile* profile) | 257 Profile* profile) |
258 : bubble_window_(bubble_window), | 258 : bubble_window_(bubble_window), |
259 label1_(NULL), | 259 label1_(NULL), |
260 label2_(NULL), | 260 label2_(NULL), |
261 label3_(NULL), | 261 label3_(NULL), |
262 close_button_(NULL) { | 262 close_button_(NULL) { |
263 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 263 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
264 gfx::Font& font = rb.GetFont(ResourceBundle::MediumFont); | 264 const gfx::Font& font = rb.GetFont(ResourceBundle::MediumFont); |
265 | 265 |
266 label1_ = new views::Label(l10n_util::GetString(IDS_FR_OEM_BUBBLE_TITLE_1)); | 266 label1_ = new views::Label(l10n_util::GetString(IDS_FR_OEM_BUBBLE_TITLE_1)); |
267 label1_->SetFont(font.DeriveFont(3, gfx::Font::BOLD)); | 267 label1_->SetFont(font.DeriveFont(3, gfx::Font::BOLD)); |
268 label1_->SetColor(SK_ColorRED); | 268 label1_->SetColor(SK_ColorRED); |
269 label1_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); | 269 label1_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); |
270 AddChildView(label1_); | 270 AddChildView(label1_); |
271 | 271 |
272 label2_ = new views::Label(l10n_util::GetString(IDS_FR_OEM_BUBBLE_TITLE_2)); | 272 label2_ = new views::Label(l10n_util::GetString(IDS_FR_OEM_BUBBLE_TITLE_2)); |
273 label2_->SetFont(font.DeriveFont(3, gfx::Font::BOLD)); | 273 label2_->SetFont(font.DeriveFont(3, gfx::Font::BOLD)); |
274 label2_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); | 274 label2_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 } | 408 } |
409 | 409 |
410 void FirstRunBubble::InfoBubbleClosing(InfoBubble* info_bubble, | 410 void FirstRunBubble::InfoBubbleClosing(InfoBubble* info_bubble, |
411 bool closed_by_escape) { | 411 bool closed_by_escape) { |
412 // Make sure our parent window is re-enabled. | 412 // Make sure our parent window is re-enabled. |
413 if (!IsWindowEnabled(GetParent())) | 413 if (!IsWindowEnabled(GetParent())) |
414 ::EnableWindow(GetParent(), true); | 414 ::EnableWindow(GetParent(), true); |
415 enable_window_method_factory_.RevokeAll(); | 415 enable_window_method_factory_.RevokeAll(); |
416 GetFocusManager()->RemoveFocusChangeListener(view_); | 416 GetFocusManager()->RemoveFocusChangeListener(view_); |
417 } | 417 } |
OLD | NEW |