Chromium Code Reviews| 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" |
| 11 #include "base/debug/trace_event.h" | 11 #include "base/debug/trace_event.h" |
| 12 #include "base/i18n/rtl.h" | 12 #include "base/i18n/rtl.h" |
| 13 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
| 14 #include "base/values.h" | 14 #include "base/values.h" |
| 15 #include "chrome/browser/chrome_notification_types.h" | 15 #include "chrome/browser/chrome_notification_types.h" |
| 16 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" | 16 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" |
| 17 #include "chrome/browser/chromeos/login/login_display_host_impl.h" | 17 #include "chrome/browser/chromeos/login/login_display_host_impl.h" |
| 18 #include "chrome/browser/chromeos/login/proxy_settings_dialog.h" | 18 #include "chrome/browser/chromeos/login/proxy_settings_dialog.h" |
| 19 #include "chrome/browser/chromeos/login/webui_login_display.h" | 19 #include "chrome/browser/chromeos/login/webui_login_display.h" |
| 20 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 20 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 21 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" | 21 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" |
| 22 #include "chrome/browser/media/media_stream_infobar_delegate.h" | 22 #include "chrome/browser/media/media_stream_infobar_delegate.h" |
| 23 #include "chrome/browser/password_manager/chrome_password_manager_client.h" | 23 #include "chrome/browser/password_manager/chrome_password_manager_client.h" |
| 24 #include "chrome/browser/renderer_preferences_util.h" | 24 #include "chrome/browser/renderer_preferences_util.h" |
| 25 #include "chrome/browser/sessions/session_tab_helper.h" | |
| 25 #include "chrome/browser/ui/autofill/tab_autofill_manager_delegate.h" | 26 #include "chrome/browser/ui/autofill/tab_autofill_manager_delegate.h" |
| 26 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 27 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
| 27 #include "chrome/common/render_messages.h" | 28 #include "chrome/common/render_messages.h" |
| 28 #include "chromeos/dbus/dbus_thread_manager.h" | 29 #include "chromeos/dbus/dbus_thread_manager.h" |
| 29 #include "chromeos/dbus/session_manager_client.h" | 30 #include "chromeos/dbus/session_manager_client.h" |
| 30 #include "chromeos/network/network_state.h" | 31 #include "chromeos/network/network_state.h" |
| 31 #include "chromeos/network/network_state_handler.h" | 32 #include "chromeos/network/network_state_handler.h" |
| 32 #include "components/password_manager/core/browser/password_manager.h" | 33 #include "components/password_manager/core/browser/password_manager.h" |
| 33 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 34 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| 34 #include "content/public/browser/notification_service.h" | 35 #include "content/public/browser/notification_service.h" |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 165 | 166 |
| 166 void WebUILoginView::Init() { | 167 void WebUILoginView::Init() { |
| 167 Profile* signin_profile = ProfileHelper::GetSigninProfile(); | 168 Profile* signin_profile = ProfileHelper::GetSigninProfile(); |
| 168 auth_extension_.reset(new ScopedGaiaAuthExtension(signin_profile)); | 169 auth_extension_.reset(new ScopedGaiaAuthExtension(signin_profile)); |
| 169 webui_login_ = new views::WebView(signin_profile); | 170 webui_login_ = new views::WebView(signin_profile); |
| 170 webui_login_->set_allow_accelerators(true); | 171 webui_login_->set_allow_accelerators(true); |
| 171 AddChildView(webui_login_); | 172 AddChildView(webui_login_); |
| 172 | 173 |
| 173 WebContents* web_contents = webui_login_->GetWebContents(); | 174 WebContents* web_contents = webui_login_->GetWebContents(); |
| 174 | 175 |
| 176 // Ensure that the login UI has a tab ID, which will allow the GAIA auth | |
| 177 // extension's background script to tell it apart from a captive portal window | |
| 178 // that may be opened on top of this UI. | |
| 179 SessionTabHelper::CreateForWebContents(web_contents); | |
|
guohui
2014/04/28 16:29:24
could you please move this to inline_login_ui.cc s
xiyuan
2014/04/28 16:30:22
Cros login screen does not use InlinLoginUI. This
guohui
2014/04/28 16:40:24
as discussed with xiyuan over chat, i ll handle th
| |
| 180 | |
| 175 // Create the password manager that is needed for the proxy. | 181 // Create the password manager that is needed for the proxy. |
| 176 ChromePasswordManagerClient::CreateForWebContentsWithAutofillManagerDelegate( | 182 ChromePasswordManagerClient::CreateForWebContentsWithAutofillManagerDelegate( |
| 177 web_contents, | 183 web_contents, |
| 178 autofill::TabAutofillManagerDelegate::FromWebContents(web_contents)); | 184 autofill::TabAutofillManagerDelegate::FromWebContents(web_contents)); |
| 179 | 185 |
| 180 // LoginHandlerViews uses a constrained window for the password manager view. | 186 // LoginHandlerViews uses a constrained window for the password manager view. |
| 181 WebContentsModalDialogManager::CreateForWebContents(web_contents); | 187 WebContentsModalDialogManager::CreateForWebContents(web_contents); |
| 182 WebContentsModalDialogManager::FromWebContents(web_contents)-> | 188 WebContentsModalDialogManager::FromWebContents(web_contents)-> |
| 183 SetDelegate(this); | 189 SetDelegate(this); |
| 184 | 190 |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 452 webui_visible_ = true; | 458 webui_visible_ = true; |
| 453 } | 459 } |
| 454 | 460 |
| 455 void WebUILoginView::ReturnFocus(bool reverse) { | 461 void WebUILoginView::ReturnFocus(bool reverse) { |
| 456 // Return the focus to the web contents. | 462 // Return the focus to the web contents. |
| 457 webui_login_->web_contents()->FocusThroughTabTraversal(reverse); | 463 webui_login_->web_contents()->FocusThroughTabTraversal(reverse); |
| 458 GetWidget()->Activate(); | 464 GetWidget()->Activate(); |
| 459 } | 465 } |
| 460 | 466 |
| 461 } // namespace chromeos | 467 } // namespace chromeos |
| OLD | NEW |