OLD | NEW |
1 // Copyright (c) 2010 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/chromeos/login/captcha_view.h" | 5 #include "chrome/browser/chromeos/login/captcha_view.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/chromeos/login/helper.h" | 10 #include "chrome/browser/chromeos/login/helper.h" |
11 #include "chrome/browser/chromeos/login/image_downloader.h" | 11 #include "chrome/browser/chromeos/login/image_downloader.h" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 | 147 |
148 void CaptchaView::Init() { | 148 void CaptchaView::Init() { |
149 if (is_standalone_) { | 149 if (is_standalone_) { |
150 // Use rounded rect background. | 150 // Use rounded rect background. |
151 set_border(CreateWizardBorder(&BorderDefinition::kUserBorder)); | 151 set_border(CreateWizardBorder(&BorderDefinition::kUserBorder)); |
152 views::Painter* painter = CreateWizardPainter( | 152 views::Painter* painter = CreateWizardPainter( |
153 &BorderDefinition::kUserBorder); | 153 &BorderDefinition::kUserBorder); |
154 set_background(views::Background::CreateBackgroundPainter(true, painter)); | 154 set_background(views::Background::CreateBackgroundPainter(true, painter)); |
155 } | 155 } |
156 | 156 |
157 views::GridLayout* layout = CreatePanelGridLayout(this); | 157 views::GridLayout* layout = views::GridLayout::CreatePanel(this); |
158 SetLayoutManager(layout); | 158 SetLayoutManager(layout); |
159 | 159 |
160 int column_view_set_id = 0; | 160 int column_view_set_id = 0; |
161 views::ColumnSet* column_set = layout->AddColumnSet(column_view_set_id); | 161 views::ColumnSet* column_set = layout->AddColumnSet(column_view_set_id); |
162 column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1, | 162 column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1, |
163 views::GridLayout::USE_PREF, 0, 0); | 163 views::GridLayout::USE_PREF, 0, 0); |
164 layout->StartRow(0, column_view_set_id); | 164 layout->StartRow(0, column_view_set_id); |
165 Label* label = new views::Label( | 165 Label* label = new views::Label( |
166 UTF16ToWide(l10n_util::GetStringUTF16(IDS_LOGIN_CAPTCHA_INSTRUCTIONS))); | 166 UTF16ToWide(l10n_util::GetStringUTF16(IDS_LOGIN_CAPTCHA_INSTRUCTIONS))); |
167 label->SetMultiLine(true); | 167 label->SetMultiLine(true); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 layout->AddView(ok_button_, 1, 1, | 202 layout->AddView(ok_button_, 1, 1, |
203 views::GridLayout::CENTER, views::GridLayout::CENTER); | 203 views::GridLayout::CENTER, views::GridLayout::CENTER); |
204 } | 204 } |
205 | 205 |
206 // ImageDownloader will delete itself once URL is fetched. | 206 // ImageDownloader will delete itself once URL is fetched. |
207 // TODO(nkostylev): Make sure that it works after view is deleted. | 207 // TODO(nkostylev): Make sure that it works after view is deleted. |
208 new ImageDownloader(this, GURL(captcha_url_), std::string()); | 208 new ImageDownloader(this, GURL(captcha_url_), std::string()); |
209 } | 209 } |
210 | 210 |
211 } // namespace chromeos | 211 } // namespace chromeos |
OLD | NEW |