| 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/chromeos/login/captcha_view.h" | 5 #include "chrome/browser/chromeos/login/captcha_view.h" |
| 6 | 6 |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/chromeos/login/helper.h" | 9 #include "chrome/browser/chromeos/login/helper.h" |
| 10 #include "chrome/browser/chromeos/login/image_downloader.h" | 10 #include "chrome/browser/chromeos/login/image_downloader.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 views::View* parent, | 116 views::View* parent, |
| 117 views::View* child) { | 117 views::View* child) { |
| 118 // Can't focus before we're inserted into a Container. | 118 // Can't focus before we're inserted into a Container. |
| 119 if (is_add && child == this) | 119 if (is_add && child == this) |
| 120 captcha_textfield_->RequestFocus(); | 120 captcha_textfield_->RequestFocus(); |
| 121 } | 121 } |
| 122 | 122 |
| 123 bool CaptchaView::HandleKeyEvent(views::Textfield* sender, | 123 bool CaptchaView::HandleKeyEvent(views::Textfield* sender, |
| 124 const views::KeyEvent& key_event) { | 124 const views::KeyEvent& key_event) { |
| 125 if (sender == captcha_textfield_ && | 125 if (sender == captcha_textfield_ && |
| 126 key_event.GetKeyCode() == ui::VKEY_RETURN) { | 126 key_event.key_code() == ui::VKEY_RETURN) { |
| 127 if (is_standalone_) { | 127 if (is_standalone_) { |
| 128 Accept(); | 128 Accept(); |
| 129 } else { | 129 } else { |
| 130 GetDialogClientView()->AcceptWindow(); | 130 GetDialogClientView()->AcceptWindow(); |
| 131 } | 131 } |
| 132 } | 132 } |
| 133 return false; | 133 return false; |
| 134 } | 134 } |
| 135 | 135 |
| 136 void CaptchaView::OnImageDecoded(const SkBitmap& decoded_image) { | 136 void CaptchaView::OnImageDecoded(const SkBitmap& decoded_image) { |
| (...skipping 65 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 |