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" |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "chromeos/dbus/session_manager_client.h" | 29 #include "chromeos/dbus/session_manager_client.h" |
30 #include "chromeos/network/network_state.h" | 30 #include "chromeos/network/network_state.h" |
31 #include "chromeos/network/network_state_handler.h" | 31 #include "chromeos/network/network_state_handler.h" |
32 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 32 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
33 #include "content/public/browser/notification_service.h" | 33 #include "content/public/browser/notification_service.h" |
34 #include "content/public/browser/render_view_host.h" | 34 #include "content/public/browser/render_view_host.h" |
35 #include "content/public/browser/render_widget_host_view.h" | 35 #include "content/public/browser/render_widget_host_view.h" |
36 #include "content/public/browser/web_contents.h" | 36 #include "content/public/browser/web_contents.h" |
37 #include "content/public/browser/web_contents_view.h" | 37 #include "content/public/browser/web_contents_view.h" |
38 #include "content/public/browser/web_ui.h" | 38 #include "content/public/browser/web_ui.h" |
| 39 #include "third_party/WebKit/public/web/WebInputEvent.h" |
39 #include "ui/gfx/rect.h" | 40 #include "ui/gfx/rect.h" |
40 #include "ui/gfx/size.h" | 41 #include "ui/gfx/size.h" |
41 #include "ui/views/controls/webview/webview.h" | 42 #include "ui/views/controls/webview/webview.h" |
42 #include "ui/views/widget/widget.h" | 43 #include "ui/views/widget/widget.h" |
43 | 44 |
44 using content::NativeWebKeyboardEvent; | 45 using content::NativeWebKeyboardEvent; |
45 using content::RenderViewHost; | 46 using content::RenderViewHost; |
46 using content::WebContents; | 47 using content::WebContents; |
47 using web_modal::WebContentsModalDialogManager; | 48 using web_modal::WebContentsModalDialogManager; |
48 | 49 |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 } | 395 } |
395 | 396 |
396 void WebUILoginView::RequestMediaAccessPermission( | 397 void WebUILoginView::RequestMediaAccessPermission( |
397 WebContents* web_contents, | 398 WebContents* web_contents, |
398 const content::MediaStreamRequest& request, | 399 const content::MediaStreamRequest& request, |
399 const content::MediaResponseCallback& callback) { | 400 const content::MediaResponseCallback& callback) { |
400 if (MediaStreamInfoBarDelegate::Create(web_contents, request, callback)) | 401 if (MediaStreamInfoBarDelegate::Create(web_contents, request, callback)) |
401 NOTREACHED() << "Media stream not allowed for WebUI"; | 402 NOTREACHED() << "Media stream not allowed for WebUI"; |
402 } | 403 } |
403 | 404 |
| 405 bool WebUILoginView::PreHandleGestureEvent( |
| 406 content::WebContents* source, |
| 407 const blink::WebGestureEvent& event) { |
| 408 // Disable pinch zooming. |
| 409 return event.type == blink::WebGestureEvent::GesturePinchBegin || |
| 410 event.type == blink::WebGestureEvent::GesturePinchUpdate || |
| 411 event.type == blink::WebGestureEvent::GesturePinchEnd; |
| 412 } |
| 413 |
404 void WebUILoginView::DidFailProvisionalLoad( | 414 void WebUILoginView::DidFailProvisionalLoad( |
405 int64 frame_id, | 415 int64 frame_id, |
406 const base::string16& frame_unique_name, | 416 const base::string16& frame_unique_name, |
407 bool is_main_frame, | 417 bool is_main_frame, |
408 const GURL& validated_url, | 418 const GURL& validated_url, |
409 int error_code, | 419 int error_code, |
410 const base::string16& error_description, | 420 const base::string16& error_description, |
411 content::RenderViewHost* render_view_host) { | 421 content::RenderViewHost* render_view_host) { |
412 if (frame_unique_name != base::UTF8ToUTF16("gaia-frame")) | 422 if (frame_unique_name != base::UTF8ToUTF16("gaia-frame")) |
413 return; | 423 return; |
(...skipping 20 matching lines...) Expand all Loading... |
434 webui_visible_ = true; | 444 webui_visible_ = true; |
435 } | 445 } |
436 | 446 |
437 void WebUILoginView::ReturnFocus(bool reverse) { | 447 void WebUILoginView::ReturnFocus(bool reverse) { |
438 // Return the focus to the web contents. | 448 // Return the focus to the web contents. |
439 webui_login_->web_contents()->FocusThroughTabTraversal(reverse); | 449 webui_login_->web_contents()->FocusThroughTabTraversal(reverse); |
440 GetWidget()->Activate(); | 450 GetWidget()->Activate(); |
441 } | 451 } |
442 | 452 |
443 } // namespace chromeos | 453 } // namespace chromeos |
OLD | NEW |