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 "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/system/tray/system_tray.h" | 8 #include "ash/system/tray/system_tray.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 ash::SystemTray* tray = ash::Shell::GetInstance()->system_tray(); | 134 ash::SystemTray* tray = ash::Shell::GetInstance()->system_tray(); |
135 if (tray) | 135 if (tray) |
136 tray->SetNextFocusableView(NULL); | 136 tray->SetNextFocusableView(NULL); |
137 } | 137 } |
138 | 138 |
139 void WebUILoginView::Init(views::Widget* login_window) { | 139 void WebUILoginView::Init(views::Widget* login_window) { |
140 login_window_ = login_window; | 140 login_window_ = login_window; |
141 webui_login_ = new views::WebView(ProfileManager::GetDefaultProfile()); | 141 webui_login_ = new views::WebView(ProfileManager::GetDefaultProfile()); |
142 AddChildView(webui_login_); | 142 AddChildView(webui_login_); |
143 | 143 |
144 // We create the WebContents ourselves because the TCW assumes ownership of | 144 // We create the WebContents ourselves because the TabContents assumes |
145 // it. This should be reworked once we don't need to use the TCW here. | 145 // ownership of it. This should be reworked once we don't need to use the |
| 146 // TabContents here. |
146 WebContents* web_contents = | 147 WebContents* web_contents = |
147 WebContents::Create(ProfileManager::GetDefaultProfile(), | 148 WebContents::Create(ProfileManager::GetDefaultProfile(), |
148 NULL, | 149 NULL, |
149 MSG_ROUTING_NONE, | 150 MSG_ROUTING_NONE, |
150 NULL, | 151 NULL, |
151 NULL); | 152 NULL); |
152 tab_contents_.reset(new TabContents(web_contents)); | 153 tab_contents_.reset(new TabContents(web_contents)); |
153 webui_login_->SetWebContents(web_contents); | 154 webui_login_->SetWebContents(web_contents); |
154 | 155 |
155 web_contents->SetDelegate(this); | 156 web_contents->SetDelegate(this); |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 oobe_ui->OnLoginPromptVisible(); | 334 oobe_ui->OnLoginPromptVisible(); |
334 } | 335 } |
335 | 336 |
336 void WebUILoginView::ReturnFocus(bool reverse) { | 337 void WebUILoginView::ReturnFocus(bool reverse) { |
337 // Return the focus to the web contents. | 338 // Return the focus to the web contents. |
338 webui_login_->web_contents()->FocusThroughTabTraversal(reverse); | 339 webui_login_->web_contents()->FocusThroughTabTraversal(reverse); |
339 GetWidget()->Activate(); | 340 GetWidget()->Activate(); |
340 } | 341 } |
341 | 342 |
342 } // namespace chromeos | 343 } // namespace chromeos |
OLD | NEW |