| 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/i18n/rtl.h" | 11 #include "base/i18n/rtl.h" |
| 12 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 13 #include "base/trace_event/trace_event.h" | 13 #include "base/trace_event/trace_event.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_devices_controller.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 "chromeos/dbus/dbus_thread_manager.h" | 29 #include "chromeos/dbus/dbus_thread_manager.h" |
| 30 #include "chromeos/dbus/session_manager_client.h" | 30 #include "chromeos/dbus/session_manager_client.h" |
| 31 #include "chromeos/network/network_state.h" | 31 #include "chromeos/network/network_state.h" |
| 32 #include "chromeos/network/network_state_handler.h" | 32 #include "chromeos/network/network_state_handler.h" |
| 33 #include "components/password_manager/core/browser/password_manager.h" | 33 #include "components/password_manager/core/browser/password_manager.h" |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 ash::Shell::FORWARD); | 433 ash::Shell::FORWARD); |
| 434 } | 434 } |
| 435 | 435 |
| 436 return true; | 436 return true; |
| 437 } | 437 } |
| 438 | 438 |
| 439 void WebUILoginView::RequestMediaAccessPermission( | 439 void WebUILoginView::RequestMediaAccessPermission( |
| 440 WebContents* web_contents, | 440 WebContents* web_contents, |
| 441 const content::MediaStreamRequest& request, | 441 const content::MediaStreamRequest& request, |
| 442 const content::MediaResponseCallback& callback) { | 442 const content::MediaResponseCallback& callback) { |
| 443 if (MediaStreamInfoBarDelegate::Create(web_contents, request, callback)) | 443 MediaStreamDevicesController controller(web_contents, request, callback); |
| 444 if (controller.IsAskingForVideo() || controller.IsAskingForAudio()) |
| 444 NOTREACHED() << "Media stream not allowed for WebUI"; | 445 NOTREACHED() << "Media stream not allowed for WebUI"; |
| 445 } | 446 } |
| 446 | 447 |
| 447 bool WebUILoginView::CheckMediaAccessPermission( | 448 bool WebUILoginView::CheckMediaAccessPermission( |
| 448 content::WebContents* web_contents, | 449 content::WebContents* web_contents, |
| 449 const GURL& security_origin, | 450 const GURL& security_origin, |
| 450 content::MediaStreamType type) { | 451 content::MediaStreamType type) { |
| 451 return MediaCaptureDevicesDispatcher::GetInstance() | 452 return MediaCaptureDevicesDispatcher::GetInstance() |
| 452 ->CheckMediaAccessPermission(web_contents, security_origin, type); | 453 ->CheckMediaAccessPermission(web_contents, security_origin, type); |
| 453 } | 454 } |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 webui_visible_ = true; | 495 webui_visible_ = true; |
| 495 } | 496 } |
| 496 | 497 |
| 497 void WebUILoginView::ReturnFocus(bool reverse) { | 498 void WebUILoginView::ReturnFocus(bool reverse) { |
| 498 // Return the focus to the web contents. | 499 // Return the focus to the web contents. |
| 499 webui_login_->web_contents()->FocusThroughTabTraversal(reverse); | 500 webui_login_->web_contents()->FocusThroughTabTraversal(reverse); |
| 500 GetWidget()->Activate(); | 501 GetWidget()->Activate(); |
| 501 } | 502 } |
| 502 | 503 |
| 503 } // namespace chromeos | 504 } // namespace chromeos |
| OLD | NEW |