| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ui/webui_login_view.h" | 5 #include "chrome/browser/chromeos/login/ui/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/ui/login_display_host_impl.h" | 17 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" |
| 18 #include "chrome/browser/chromeos/login/ui/proxy_settings_dialog.h" | 18 #include "chrome/browser/chromeos/login/ui/proxy_settings_dialog.h" |
| 19 #include "chrome/browser/chromeos/login/ui/webui_login_display.h" | 19 #include "chrome/browser/chromeos/login/ui/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/sessions/session_tab_helper.h" |
| 26 #include "chrome/browser/ui/autofill/chrome_autofill_client.h" | 26 #include "chrome/browser/ui/autofill/chrome_autofill_client.h" |
| 27 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 27 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
| 28 #include "chrome/browser/ui/zoom/zoom_controller.h" |
| 28 #include "chrome/common/render_messages.h" | 29 #include "chrome/common/render_messages.h" |
| 29 #include "chromeos/dbus/dbus_thread_manager.h" | 30 #include "chromeos/dbus/dbus_thread_manager.h" |
| 30 #include "chromeos/dbus/session_manager_client.h" | 31 #include "chromeos/dbus/session_manager_client.h" |
| 31 #include "chromeos/network/network_state.h" | 32 #include "chromeos/network/network_state.h" |
| 32 #include "chromeos/network/network_state_handler.h" | 33 #include "chromeos/network/network_state_handler.h" |
| 33 #include "components/password_manager/core/browser/password_manager.h" | 34 #include "components/password_manager/core/browser/password_manager.h" |
| 34 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 35 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| 35 #include "content/public/browser/notification_service.h" | 36 #include "content/public/browser/notification_service.h" |
| 36 #include "content/public/browser/render_frame_host.h" | 37 #include "content/public/browser/render_frame_host.h" |
| 37 #include "content/public/browser/render_view_host.h" | 38 #include "content/public/browser/render_view_host.h" |
| 38 #include "content/public/browser/render_widget_host_view.h" | 39 #include "content/public/browser/render_widget_host_view.h" |
| 39 #include "content/public/browser/web_contents.h" | 40 #include "content/public/browser/web_contents.h" |
| 40 #include "content/public/browser/web_ui.h" | 41 #include "content/public/browser/web_ui.h" |
| 42 #include "content/public/common/renderer_preferences.h" |
| 41 #include "third_party/WebKit/public/web/WebInputEvent.h" | 43 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 42 #include "ui/gfx/rect.h" | 44 #include "ui/gfx/rect.h" |
| 43 #include "ui/gfx/size.h" | 45 #include "ui/gfx/size.h" |
| 44 #include "ui/views/controls/webview/webview.h" | 46 #include "ui/views/controls/webview/webview.h" |
| 45 #include "ui/views/widget/widget.h" | 47 #include "ui/views/widget/widget.h" |
| 46 | 48 |
| 47 using content::NativeWebKeyboardEvent; | 49 using content::NativeWebKeyboardEvent; |
| 48 using content::RenderViewHost; | 50 using content::RenderViewHost; |
| 49 using content::WebContents; | 51 using content::WebContents; |
| 50 using web_modal::WebContentsModalDialogManager; | 52 using web_modal::WebContentsModalDialogManager; |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 WebContentsModalDialogManager::FromWebContents(web_contents)-> | 207 WebContentsModalDialogManager::FromWebContents(web_contents)-> |
| 206 SetDelegate(this); | 208 SetDelegate(this); |
| 207 if (!popup_manager_.get()) | 209 if (!popup_manager_.get()) |
| 208 popup_manager_.reset(new web_modal::PopupManager(this)); | 210 popup_manager_.reset(new web_modal::PopupManager(this)); |
| 209 popup_manager_->RegisterWith(web_contents); | 211 popup_manager_->RegisterWith(web_contents); |
| 210 | 212 |
| 211 web_contents->SetDelegate(this); | 213 web_contents->SetDelegate(this); |
| 212 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents( | 214 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents( |
| 213 web_contents); | 215 web_contents); |
| 214 WebContentsObserver::Observe(web_contents); | 216 WebContentsObserver::Observe(web_contents); |
| 215 renderer_preferences_util::UpdateFromSystemSettings( | 217 content::RendererPreferences* prefs = web_contents->GetMutableRendererPrefs(); |
| 216 web_contents->GetMutableRendererPrefs(), | 218 renderer_preferences_util::UpdateFromSystemSettings(prefs, signin_profile); |
| 217 signin_profile); | 219 prefs->default_zoom_level = |
| 220 ZoomController::FromWebContents(web_contents)->GetDefaultZoomLevel(); |
| 218 } | 221 } |
| 219 | 222 |
| 220 const char* WebUILoginView::GetClassName() const { | 223 const char* WebUILoginView::GetClassName() const { |
| 221 return kViewClassName; | 224 return kViewClassName; |
| 222 } | 225 } |
| 223 | 226 |
| 224 void WebUILoginView::RequestFocus() { | 227 void WebUILoginView::RequestFocus() { |
| 225 webui_login_->RequestFocus(); | 228 webui_login_->RequestFocus(); |
| 226 } | 229 } |
| 227 | 230 |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 webui_visible_ = true; | 496 webui_visible_ = true; |
| 494 } | 497 } |
| 495 | 498 |
| 496 void WebUILoginView::ReturnFocus(bool reverse) { | 499 void WebUILoginView::ReturnFocus(bool reverse) { |
| 497 // Return the focus to the web contents. | 500 // Return the focus to the web contents. |
| 498 webui_login_->web_contents()->FocusThroughTabTraversal(reverse); | 501 webui_login_->web_contents()->FocusThroughTabTraversal(reverse); |
| 499 GetWidget()->Activate(); | 502 GetWidget()->Activate(); |
| 500 } | 503 } |
| 501 | 504 |
| 502 } // namespace chromeos | 505 } // namespace chromeos |
| OLD | NEW |