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_capture_devices_dispatcher.h" | 22 #include "chrome/browser/media/media_capture_devices_dispatcher.h" |
23 #include "chrome/browser/media/media_stream_infobar_delegate.h" | 23 #include "chrome/browser/media/media_stream_infobar_delegate.h" |
24 #include "chrome/browser/password_manager/chrome_password_manager_client.h" | 24 #include "chrome/browser/password_manager/chrome_password_manager_client.h" |
25 #include "chrome/browser/renderer_preferences_util.h" | 25 #include "chrome/browser/renderer_preferences_util.h" |
26 #include "chrome/browser/sessions/session_tab_helper.h" | 26 #include "chrome/browser/sessions/session_tab_helper.h" |
27 #include "chrome/browser/ui/autofill/chrome_autofill_client.h" | 27 #include "chrome/browser/ui/autofill/chrome_autofill_client.h" |
28 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 28 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
| 29 #include "chrome/browser/ui/zoom/zoom_controller.h" |
29 #include "chrome/common/render_messages.h" | 30 #include "chrome/common/render_messages.h" |
30 #include "chromeos/dbus/dbus_thread_manager.h" | 31 #include "chromeos/dbus/dbus_thread_manager.h" |
31 #include "chromeos/dbus/session_manager_client.h" | 32 #include "chromeos/dbus/session_manager_client.h" |
32 #include "chromeos/network/network_state.h" | 33 #include "chromeos/network/network_state.h" |
33 #include "chromeos/network/network_state_handler.h" | 34 #include "chromeos/network/network_state_handler.h" |
34 #include "components/password_manager/core/browser/password_manager.h" | 35 #include "components/password_manager/core/browser/password_manager.h" |
35 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 36 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
36 #include "content/public/browser/notification_service.h" | 37 #include "content/public/browser/notification_service.h" |
37 #include "content/public/browser/render_frame_host.h" | 38 #include "content/public/browser/render_frame_host.h" |
38 #include "content/public/browser/render_view_host.h" | 39 #include "content/public/browser/render_view_host.h" |
39 #include "content/public/browser/render_widget_host_view.h" | 40 #include "content/public/browser/render_widget_host_view.h" |
40 #include "content/public/browser/web_contents.h" | 41 #include "content/public/browser/web_contents.h" |
41 #include "content/public/browser/web_ui.h" | 42 #include "content/public/browser/web_ui.h" |
| 43 #include "content/public/common/renderer_preferences.h" |
42 #include "third_party/WebKit/public/web/WebInputEvent.h" | 44 #include "third_party/WebKit/public/web/WebInputEvent.h" |
43 #include "ui/gfx/rect.h" | 45 #include "ui/gfx/rect.h" |
44 #include "ui/gfx/size.h" | 46 #include "ui/gfx/size.h" |
45 #include "ui/views/controls/webview/webview.h" | 47 #include "ui/views/controls/webview/webview.h" |
46 #include "ui/views/widget/widget.h" | 48 #include "ui/views/widget/widget.h" |
47 | 49 |
48 using content::NativeWebKeyboardEvent; | 50 using content::NativeWebKeyboardEvent; |
49 using content::RenderViewHost; | 51 using content::RenderViewHost; |
50 using content::WebContents; | 52 using content::WebContents; |
51 using web_modal::WebContentsModalDialogManager; | 53 using web_modal::WebContentsModalDialogManager; |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 WebContentsModalDialogManager::FromWebContents(web_contents)-> | 208 WebContentsModalDialogManager::FromWebContents(web_contents)-> |
207 SetDelegate(this); | 209 SetDelegate(this); |
208 if (!popup_manager_.get()) | 210 if (!popup_manager_.get()) |
209 popup_manager_.reset(new web_modal::PopupManager(this)); | 211 popup_manager_.reset(new web_modal::PopupManager(this)); |
210 popup_manager_->RegisterWith(web_contents); | 212 popup_manager_->RegisterWith(web_contents); |
211 | 213 |
212 web_contents->SetDelegate(this); | 214 web_contents->SetDelegate(this); |
213 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents( | 215 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents( |
214 web_contents); | 216 web_contents); |
215 WebContentsObserver::Observe(web_contents); | 217 WebContentsObserver::Observe(web_contents); |
216 renderer_preferences_util::UpdateFromSystemSettings( | 218 content::RendererPreferences* prefs = web_contents->GetMutableRendererPrefs(); |
217 web_contents->GetMutableRendererPrefs(), | 219 renderer_preferences_util::UpdateFromSystemSettings(prefs, signin_profile); |
218 signin_profile); | 220 prefs->default_zoom_level = |
| 221 ZoomController::FromWebContents(web_contents)->GetDefaultZoomLevel(); |
219 } | 222 } |
220 | 223 |
221 const char* WebUILoginView::GetClassName() const { | 224 const char* WebUILoginView::GetClassName() const { |
222 return kViewClassName; | 225 return kViewClassName; |
223 } | 226 } |
224 | 227 |
225 void WebUILoginView::RequestFocus() { | 228 void WebUILoginView::RequestFocus() { |
226 webui_login_->RequestFocus(); | 229 webui_login_->RequestFocus(); |
227 } | 230 } |
228 | 231 |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 webui_visible_ = true; | 505 webui_visible_ = true; |
503 } | 506 } |
504 | 507 |
505 void WebUILoginView::ReturnFocus(bool reverse) { | 508 void WebUILoginView::ReturnFocus(bool reverse) { |
506 // Return the focus to the web contents. | 509 // Return the focus to the web contents. |
507 webui_login_->web_contents()->FocusThroughTabTraversal(reverse); | 510 webui_login_->web_contents()->FocusThroughTabTraversal(reverse); |
508 GetWidget()->Activate(); | 511 GetWidget()->Activate(); |
509 } | 512 } |
510 | 513 |
511 } // namespace chromeos | 514 } // namespace chromeos |
OLD | NEW |