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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 WebContentsModalDialogManager::FromWebContents(web_contents)-> | 198 WebContentsModalDialogManager::FromWebContents(web_contents)-> |
197 SetDelegate(this); | 199 SetDelegate(this); |
198 if (!popup_manager_.get()) | 200 if (!popup_manager_.get()) |
199 popup_manager_.reset(new web_modal::PopupManager(this)); | 201 popup_manager_.reset(new web_modal::PopupManager(this)); |
200 popup_manager_->RegisterWith(web_contents); | 202 popup_manager_->RegisterWith(web_contents); |
201 | 203 |
202 web_contents->SetDelegate(this); | 204 web_contents->SetDelegate(this); |
203 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents( | 205 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents( |
204 web_contents); | 206 web_contents); |
205 WebContentsObserver::Observe(web_contents); | 207 WebContentsObserver::Observe(web_contents); |
206 renderer_preferences_util::UpdateFromSystemSettings( | 208 content::RendererPreferences* prefs = web_contents->GetMutableRendererPrefs(); |
207 web_contents->GetMutableRendererPrefs(), | 209 renderer_preferences_util::UpdateFromSystemSettings(prefs, signin_profile); |
208 signin_profile); | 210 prefs->default_zoom_level = |
| 211 ZoomController::FromWebContents(web_contents)->GetDefaultZoomLevel(); |
209 } | 212 } |
210 | 213 |
211 const char* WebUILoginView::GetClassName() const { | 214 const char* WebUILoginView::GetClassName() const { |
212 return kViewClassName; | 215 return kViewClassName; |
213 } | 216 } |
214 | 217 |
215 void WebUILoginView::RequestFocus() { | 218 void WebUILoginView::RequestFocus() { |
216 webui_login_->RequestFocus(); | 219 webui_login_->RequestFocus(); |
217 } | 220 } |
218 | 221 |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 webui_visible_ = true; | 495 webui_visible_ = true; |
493 } | 496 } |
494 | 497 |
495 void WebUILoginView::ReturnFocus(bool reverse) { | 498 void WebUILoginView::ReturnFocus(bool reverse) { |
496 // Return the focus to the web contents. | 499 // Return the focus to the web contents. |
497 webui_login_->web_contents()->FocusThroughTabTraversal(reverse); | 500 webui_login_->web_contents()->FocusThroughTabTraversal(reverse); |
498 GetWidget()->Activate(); | 501 GetWidget()->Activate(); |
499 } | 502 } |
500 | 503 |
501 } // namespace chromeos | 504 } // namespace chromeos |
OLD | NEW |