OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 void WebUILoginView::Init(views::Widget* login_window) { | 151 void WebUILoginView::Init(views::Widget* login_window) { |
152 login_window_ = login_window; | 152 login_window_ = login_window; |
153 webui_login_ = new DOMView(); | 153 webui_login_ = new DOMView(); |
154 AddChildView(webui_login_); | 154 AddChildView(webui_login_); |
155 webui_login_->Init(ProfileManager::GetDefaultProfile(), NULL); | 155 webui_login_->Init(ProfileManager::GetDefaultProfile(), NULL); |
156 webui_login_->SetVisible(true); | 156 webui_login_->SetVisible(true); |
157 | 157 |
158 WebContents* web_contents = webui_login_->dom_contents()->web_contents(); | 158 WebContents* web_contents = webui_login_->dom_contents()->web_contents(); |
159 web_contents->SetDelegate(this); | 159 web_contents->SetDelegate(this); |
160 | 160 |
161 tab_watcher_.reset(new TabFirstRenderWatcher(web_contents, this)); | 161 tab_watcher_.reset(new TabRenderWatcher(web_contents, this)); |
162 } | 162 } |
163 | 163 |
164 std::string WebUILoginView::GetClassName() const { | 164 std::string WebUILoginView::GetClassName() const { |
165 return kViewClassName; | 165 return kViewClassName; |
166 } | 166 } |
167 | 167 |
168 bool WebUILoginView::AcceleratorPressed( | 168 bool WebUILoginView::AcceleratorPressed( |
169 const ui::Accelerator& accelerator) { | 169 const ui::Accelerator& accelerator) { |
170 AccelMap::const_iterator entry = accel_map_.find(accelerator); | 170 AccelMap::const_iterator entry = accel_map_.find(accelerator); |
171 if (entry == accel_map_.end()) | 171 if (entry == accel_map_.end()) |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 } | 282 } |
283 | 283 |
284 void WebUILoginView::OnRenderHostCreated(RenderViewHost* host) { | 284 void WebUILoginView::OnRenderHostCreated(RenderViewHost* host) { |
285 new SnifferObserver(host, GetWebUI()); | 285 new SnifferObserver(host, GetWebUI()); |
286 } | 286 } |
287 | 287 |
288 void WebUILoginView::OnTabMainFrameLoaded() { | 288 void WebUILoginView::OnTabMainFrameLoaded() { |
289 VLOG(1) << "WebUI login main frame loaded."; | 289 VLOG(1) << "WebUI login main frame loaded."; |
290 } | 290 } |
291 | 291 |
292 void WebUILoginView::OnTabMainFrameFirstRender() { | 292 void WebUILoginView::OnTabMainFrameRender() { |
293 VLOG(1) << "WebUI login main frame rendered."; | 293 VLOG(1) << "WebUI login main frame rendered."; |
| 294 tab_watcher_.reset(); |
294 StatusAreaViewChromeos::SetScreenMode(GetScreenMode()); | 295 StatusAreaViewChromeos::SetScreenMode(GetScreenMode()); |
295 // In aura there's a global status area shown already. | 296 // In aura there's a global status area shown already. |
296 #if defined(USE_AURA) | 297 #if defined(USE_AURA) |
297 status_area_ = ChromeShellDelegate::instance()->GetStatusArea(); | 298 status_area_ = ChromeShellDelegate::instance()->GetStatusArea(); |
298 status_area_->SetVisible(status_area_visibility_on_init_); | 299 status_area_->SetVisible(status_area_visibility_on_init_); |
299 #else | 300 #else |
300 InitStatusArea(); | 301 InitStatusArea(); |
301 #endif | 302 #endif |
302 | 303 |
303 #if defined(TOOLKIT_USES_GTK) | 304 #if defined(TOOLKIT_USES_GTK) |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 // when the focus is inside an iframe. Only clear on KeyDown to prevent hiding | 424 // when the focus is inside an iframe. Only clear on KeyDown to prevent hiding |
424 // an immediate authentication error (See crbug.com/103643). | 425 // an immediate authentication error (See crbug.com/103643). |
425 if (event.type == WebKit::WebInputEvent::KeyDown) { | 426 if (event.type == WebKit::WebInputEvent::KeyDown) { |
426 content::WebUI* web_ui = GetWebUI(); | 427 content::WebUI* web_ui = GetWebUI(); |
427 if (web_ui) | 428 if (web_ui) |
428 web_ui->CallJavascriptFunction("cr.ui.Oobe.clearErrors"); | 429 web_ui->CallJavascriptFunction("cr.ui.Oobe.clearErrors"); |
429 } | 430 } |
430 } | 431 } |
431 | 432 |
432 } // namespace chromeos | 433 } // namespace chromeos |
OLD | NEW |