| 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/webui_login_view.h" | 5 #include "chrome/browser/chromeos/login/webui_login_view.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 : status_area_(NULL), | 111 : status_area_(NULL), |
| 112 webui_login_(NULL), | 112 webui_login_(NULL), |
| 113 login_window_(NULL), | 113 login_window_(NULL), |
| 114 status_window_(NULL), | 114 status_window_(NULL), |
| 115 host_window_frozen_(false), | 115 host_window_frozen_(false), |
| 116 status_area_visibility_on_init_(true) { | 116 status_area_visibility_on_init_(true) { |
| 117 #if defined(USE_VIRTUAL_KEYBOARD) | 117 #if defined(USE_VIRTUAL_KEYBOARD) |
| 118 // Make sure the singleton VirtualKeyboardManager object is created. | 118 // Make sure the singleton VirtualKeyboardManager object is created. |
| 119 VirtualKeyboardManager::GetInstance(); | 119 VirtualKeyboardManager::GetInstance(); |
| 120 #endif | 120 #endif |
| 121 accel_map_[views::Accelerator(ui::VKEY_Z, false, true, true)] = | 121 accel_map_[ui::Accelerator(ui::VKEY_Z, false, true, true)] = |
| 122 kAccelNameAccessibility; | 122 kAccelNameAccessibility; |
| 123 accel_map_[views::Accelerator(ui::VKEY_ESCAPE, false, false, false)] = | 123 accel_map_[ui::Accelerator(ui::VKEY_ESCAPE, false, false, false)] = |
| 124 kAccelNameCancel; | 124 kAccelNameCancel; |
| 125 accel_map_[views::Accelerator(ui::VKEY_E, false, true, true)] = | 125 accel_map_[ui::Accelerator(ui::VKEY_E, false, true, true)] = |
| 126 kAccelNameEnrollment; | 126 kAccelNameEnrollment; |
| 127 | 127 |
| 128 for (AccelMap::iterator i(accel_map_.begin()); i != accel_map_.end(); ++i) | 128 for (AccelMap::iterator i(accel_map_.begin()); i != accel_map_.end(); ++i) |
| 129 AddAccelerator(i->first); | 129 AddAccelerator(i->first); |
| 130 } | 130 } |
| 131 | 131 |
| 132 WebUILoginView::~WebUILoginView() { | 132 WebUILoginView::~WebUILoginView() { |
| 133 if (status_window_) | 133 if (status_window_) |
| 134 status_window_->CloseNow(); | 134 status_window_->CloseNow(); |
| 135 status_window_ = NULL; | 135 status_window_ = NULL; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 146 tab_contents->set_delegate(this); | 146 tab_contents->set_delegate(this); |
| 147 | 147 |
| 148 tab_watcher_.reset(new TabFirstRenderWatcher(tab_contents, this)); | 148 tab_watcher_.reset(new TabFirstRenderWatcher(tab_contents, this)); |
| 149 } | 149 } |
| 150 | 150 |
| 151 std::string WebUILoginView::GetClassName() const { | 151 std::string WebUILoginView::GetClassName() const { |
| 152 return kViewClassName; | 152 return kViewClassName; |
| 153 } | 153 } |
| 154 | 154 |
| 155 bool WebUILoginView::AcceleratorPressed( | 155 bool WebUILoginView::AcceleratorPressed( |
| 156 const views::Accelerator& accelerator) { | 156 const ui::Accelerator& accelerator) { |
| 157 AccelMap::const_iterator entry = accel_map_.find(accelerator); | 157 AccelMap::const_iterator entry = accel_map_.find(accelerator); |
| 158 if (entry == accel_map_.end()) | 158 if (entry == accel_map_.end()) |
| 159 return false; | 159 return false; |
| 160 | 160 |
| 161 if (!webui_login_) | 161 if (!webui_login_) |
| 162 return true; | 162 return true; |
| 163 | 163 |
| 164 WebUI* web_ui = GetWebUI(); | 164 WebUI* web_ui = GetWebUI(); |
| 165 if (web_ui) { | 165 if (web_ui) { |
| 166 base::StringValue accel_name(entry->second); | 166 base::StringValue accel_name(entry->second); |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 // when the focus is inside an iframe. Only clear on KeyDown to prevent hiding | 409 // when the focus is inside an iframe. Only clear on KeyDown to prevent hiding |
| 410 // an immediate authentication error (See crbug.com/103643). | 410 // an immediate authentication error (See crbug.com/103643). |
| 411 if (event.type == WebKit::WebInputEvent::KeyDown) { | 411 if (event.type == WebKit::WebInputEvent::KeyDown) { |
| 412 WebUI* web_ui = GetWebUI(); | 412 WebUI* web_ui = GetWebUI(); |
| 413 if (web_ui) | 413 if (web_ui) |
| 414 web_ui->CallJavascriptFunction("cr.ui.Oobe.clearErrors"); | 414 web_ui->CallJavascriptFunction("cr.ui.Oobe.clearErrors"); |
| 415 } | 415 } |
| 416 } | 416 } |
| 417 | 417 |
| 418 } // namespace chromeos | 418 } // namespace chromeos |
| OLD | NEW |